Skip to content

Commit 7ba52ea

Browse files
Tomasz Bursztykanashif
authored andcommitted
net/ipv6: Set the right protocol when finalizing MLD packet
IPv6 next header might be something else (here NET_IPV6_NEXTHDR_HBHO) but when finalizing it is mandatory to give the actual last header protocol type. In this case IPPROTO_ICMPV6, so the checksum can be computed properly then by net_icmpv6_finalize() called from net_ipv6_finalize(). Fixes #14663 Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent 8c29499 commit 7ba52ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/net/ip/ipv6_mld.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ static int mld_create_packet(struct net_pkt *pkt, u16_t count)
117117
return -ENOBUFS;
118118
}
119119

120-
net_pkt_set_ipv6_next_hdr(pkt, IPPROTO_ICMPV6);
120+
net_pkt_set_ipv6_next_hdr(pkt, NET_IPV6_NEXTHDR_HBHO);
121121

122122
return 0;
123123
}
124124

125125
static int mld_send(struct net_pkt *pkt)
126126
{
127127
net_pkt_cursor_init(pkt);
128-
net_ipv6_finalize(pkt, NET_IPV6_NEXTHDR_HBHO);
128+
net_ipv6_finalize(pkt, IPPROTO_ICMPV6);
129129

130130
if (net_send_data(pkt) < 0) {
131131
net_stats_update_icmp_drop(net_pkt_iface(pkt));

0 commit comments

Comments
 (0)