@@ -118,48 +118,6 @@ void net_eth_ipv6_mcast_to_mac_addr(const struct in6_addr *ipv6_addr,
118
118
#define print_vlan_ll_addrs (...)
119
119
#endif /* CONFIG_NET_VLAN */
120
120
121
- static inline void ethernet_update_length (struct net_if * iface ,
122
- struct net_pkt * pkt )
123
- {
124
- uint16_t len ;
125
- #ifdef CONFIG_NET_VLAN
126
- const uint16_t min_len =
127
- NET_ETH_MINIMAL_FRAME_SIZE - (net_pkt_vlan_tag (pkt ) != NET_VLAN_TAG_UNSPEC
128
- ? sizeof (struct net_eth_vlan_hdr )
129
- : sizeof (struct net_eth_hdr ));
130
- #else
131
- const uint16_t min_len = NET_ETH_MINIMAL_FRAME_SIZE - sizeof (struct net_eth_hdr );
132
- #endif
133
-
134
- /* Let's check IP payload's length. If it's smaller than 46 bytes,
135
- * i.e. smaller than minimal Ethernet frame size minus ethernet
136
- * header size,then Ethernet has padded so it fits in the minimal
137
- * frame size of 60 bytes. In that case, we need to get rid of it.
138
- */
139
-
140
- if (net_pkt_family (pkt ) == AF_INET ) {
141
- len = ntohs (NET_IPV4_HDR (pkt )-> len );
142
- } else if (net_pkt_family (pkt ) == AF_INET6 ) {
143
- len = ntohs (NET_IPV6_HDR (pkt )-> len ) + NET_IPV6H_LEN ;
144
- } else {
145
- return ;
146
- }
147
-
148
- if (len < min_len ) {
149
- struct net_buf * frag ;
150
-
151
- for (frag = pkt -> frags ; frag ; frag = frag -> frags ) {
152
- if (frag -> len < len ) {
153
- len -= frag -> len ;
154
- } else {
155
- frag -> len = len ;
156
- len = 0U ;
157
- }
158
- }
159
- }
160
- }
161
-
162
-
163
121
static void ethernet_update_rx_stats (struct net_if * iface , size_t length ,
164
122
bool dst_broadcast , bool dst_eth_multicast )
165
123
{
@@ -357,10 +315,6 @@ static enum net_verdict ethernet_recv(struct net_if *iface,
357
315
358
316
body_len = net_pkt_get_len (pkt );
359
317
360
- if (type != NET_ETH_PTYPE_EAPOL ) {
361
- ethernet_update_length (iface , pkt );
362
- }
363
-
364
318
ethernet_update_rx_stats (iface , body_len + hdr_len , dst_broadcast , dst_eth_multicast );
365
319
return verdict ;
366
320
drop :
0 commit comments