IPv6 neighbors get added too eagerly #21869
Labels
area: Networking
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
When receiving an IPv6 neighbor solicitation packet, the sender gets added to the neighbor cache even if the NS was not intended for this node. Then a NS packet is sent back to the sender.
This has some bad consequences:
This behavior strikes me as odd, and not in line with RFC 4861 section 7.2.3 which states that neighbor solicitation packets to an address not on the receiving interface should be discarded.
The responsible code is in handle_ns_input() which calls handle_ns_neighbor() too early (before deciding to respond the the NS), which calls net_ipv6_nbr_add().
Any idea if this behavior is intentional? Would anything break if it were changed to add a cache entry only in the cases where a neighbor advertisement gets sent?
Environment: zephyr-v2.1.0-915-gd4ad36e8d6
Impact: Annoyance, NET_IPV6_MAX_NEIGHBORS must be set unnecessarily high
The text was updated successfully, but these errors were encountered: