URL:
<https://savannah.nongnu.org/bugs/?59319> Summary: ICMPv6 neighbor solicitation fails if LWIP_IPV6_MLD is set Project: lwIP - A Lightweight TCP/IP stack Submitted by: cyberdeck Submitted on: Thu 22 Oct 2020 02:29:34 PM UTC Category: IPv6 Severity: 3 - Normal Item Group: Faulty Behaviour Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None lwIP version: git head _______________________________________________________ Details: In the IPv6 stack neighbor solicitation packages are dropped if LWIP_IPV6_MLD is set. For me it seems that this is a logical bug included in the ip6.c source. Please see the included patch. Description of the bug: If lwIP is compiled with LWIP_IPV6_MLD set, ICMPv6 neighbor solicitation messages are dropped if they are targeted for the solicited-node multicast address (e.g. "ff02::1:ff28:9c5a", cf. [1]). That drop is by purpose because the logic for checking the received packets against the solicited-node multicast address is excluded. In my opinion that behavior is wrong. The attached patch will fix this behavior. Effect of the bug: Bring up an interface and try to ping it's global IPv6 address. As the interface is not replying to neighbor solicitation it cannot be reached. Effect after the patch: Bring up an interface and try to ping it's global IPv6 address. Now the interface is replying to neighbor solicitation and this, it can be reached afterwards. [1]: https://en.wikipedia.org/wiki/Solicited-node_multicast_address _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Thu 22 Oct 2020 02:29:34 PM UTC Name: ipv6.patch Size: 658B By: cyberdeck <http://savannah.nongnu.org/bugs/download.php?file_id=50049> _______________________________________________________ Reply to this item at: <https://savannah.nongnu.org/bugs/?59319> _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ _______________________________________________ lwip-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/lwip-devel |
Follow-up Comment #1, bug #59319 (project lwip):
I agree that this seems strange. Originally the code was like this (commit 4bfbe7ebe): /* match packet against an interface, i.e. is this packet for us? */ if (ip6_addr_ismulticast(ip6_current_dest_addr())) { /* Always joined to multicast if-local and link-local all-nodes group. */ if (ip6_addr_isallnodes_iflocal(ip6_current_dest_addr()) || ip6_addr_isallnodes_linklocal(ip6_current_dest_addr())) { netif = inp; } #if LWIP_IPV6_MLD else if (mld6_lookfor_group(inp, ip6_current_dest_addr())) { netif = inp; } #else /* LWIP_IPV6_MLD */ else if (ip6_addr_issolicitednode(ip6_current_dest_addr())) { /* Accept all solicited node packets when MLD is not enabled * (for Neighbor discovery). */ netif = inp; } #endif /* LWIP_IPV6_MLD */ else { netif = NULL; Then in commit 6e81f722a the solicited node handling was added: #else /* LWIP_IPV6_MLD */ else if (ip6_addr_issolicitednode(ip6_current_dest_addr())) { /* Filter solicited node packets when MLD is not enabled * (for Neighbor discovery). */ netif = NULL; for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) { if (ip6_addr_isvalid(netif_ip6_addr_state(inp, i)) && ip6_addr_cmp_solicitednode(ip6_current_dest_addr(), netif_ip6_addr(inp, i))) { netif = inp; LWIP_DEBUGF(IP6_DEBUG, ("ip6_input: solicited node packet accepted on interface %c%c\n", netif->name[0], netif->name[1])); break; } } } #endif /* LWIP_IPV6_MLD */ Since solicited nodes are not checked inside mld6 code, it seems this code should always be active. Simon, do you have an opinion here? _______________________________________________________ Reply to this item at: <https://savannah.nongnu.org/bugs/?59319> _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ _______________________________________________ lwip-devel mailing list [hidden email] https://lists.nongnu.org/mailman/listinfo/lwip-devel |
Free forum by Nabble | Edit this page |