Skip to content

Commit 39e37ab

Browse files
Ruslan Mstoijukkar
authored andcommitted
net: ipv6: Skip unknown options in NA message
If we receive unknown option in neighbor advertisement message, then skip those properly. Old code did not check the length of the extension options which could cause infinite loop. Jira: ZEP-2219 Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
1 parent 7a972c0 commit 39e37ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/ip/ipv6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ static enum net_verdict handle_na_input(struct net_pkt *pkt)
16621662
net_pkt_ipv6_ext_opt_len(pkt) +
16631663
(hdr->len << 3));
16641664

1665-
if (prev_opt_len == net_pkt_ipv6_ext_opt_len(pkt)) {
1665+
if (prev_opt_len >= net_pkt_ipv6_ext_opt_len(pkt)) {
16661666
NET_ERR("Corrupted NA message");
16671667
goto drop;
16681668
}

0 commit comments

Comments
 (0)