buglwIP - A Lightweight TCP/IP stack - Bugs: bug #59319, ICMPv6 neighbor solicitation fails...


You are not allowed to post comments on this tracker with your current authentication level.

bug #59319: ICMPv6 neighbor solicitation fails if LWIP_IPV6_MLD is set

Submitted by:  H. Gregor Molter <cyberdeck>
Submitted on:  Thu 22 Oct 2020 02:29:34 PM UTC
Category:  IPv6 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned Release:  None
lwIP version:  * git head
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:
       No canned response available


Sat 06 Feb 2021 03:07:23 PM UTC, comment #2: 

I managed to test this case now, and for me it worked.

ND6 joins the appropriate group:

this is triggered by netif:

Maybe you are missing the MLD6 flag on your netif?

Erik Ekman <yarrick>
Project Member
Mon 18 Jan 2021 09:05:03 PM UTC, comment #1: 

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;
    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]));
#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?

Erik Ekman <yarrick>
Project Member
Thu 22 Oct 2020 02:29:34 PM UTC, original submission:  

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

H. Gregor Molter <cyberdeck>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #50049:  ipv6.patch added by cyberdeck (658B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by yarrick (Posted a comment)
  • -email is unavailable- added by cyberdeck (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-13 yarrick StatusNone => Works For Me
        Open/ClosedOpen => Closed
    2020-10-22 cyberdeck Attached File- => Added ipv6.patch, #50049

    Back to the top

    Powered by Savane 3.9