Skip to content

Commit ff59548

Browse files
author
Tomasz Bursztyka
committed
net: ethernet: IPv6 packet length should be relevantly handled
It's much different than IPv4 where it's possible to find the whole packet length. Here it has to count also the ipv6 header size by itself. Jira: ZEP-1422 Change-Id: I84b1602ac75ef81b9ceda7898ca9dedf2e54d633 Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent a79f9bc commit ff59548

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/net/ip/l2/ethernet.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ static inline void ethernet_update_length(struct net_if *iface,
7575
NET_IPV4_BUF(buf)->len[1]);
7676
} else {
7777
len = ((NET_IPV6_BUF(buf)->len[0] << 8) +
78-
NET_IPV6_BUF(buf)->len[1]);
78+
NET_IPV6_BUF(buf)->len[1]) +
79+
NET_IPV6H_LEN;
7980
}
8081

8182
if (len < NET_ETH_MINIMAL_FRAME_SIZE - sizeof(struct net_eth_hdr)) {

0 commit comments

Comments
 (0)