buglwIP - A Lightweight TCP/IP stack - Bugs: bug #37993, IPv6 Does Not Subscribe to...

 
 

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

bug #37993: IPv6 Does Not Subscribe to Link-Local All-Nodes Multicast Group By Default

Submitter:  Grant Erickson <marathon96>
Submitted:  Sat 29 Dec 2012 12:21:51 AM UTC
   
 
Category:  IPv6 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  idelamer
Open/Closed:  Closed Planned Release:  None
lwIP version:  CVS Head

Jump to the original submission

Wed 04 Mar 2015 08:36:32 PM UTC, comment #6: 

I see two things that need to be done:

- MLD6 filter callback for netif. Put in skeleton a call to add ff02::1 by default
- Add a function/macro for adding an IPv6 address to a netif. This should handle subscribing to the solicited-node address. Now it is done in ND6 code when an address is set to TENTATIVE, but for other initial stated (e.g. PREFERRED) it is not done.

Ivan Delamer <idelamer>
Group Member
Wed 04 Mar 2015 07:31:40 PM UTC, comment #5: 

Ivan, in the context of your explanations to Sylvain today on lwip-devel: is this a matter of missing documentation only, or have there been changes?

Simon Goldschmidt <goldsimon>
Group administrator
Wed 17 Sep 2014 07:40:00 PM UTC, comment #4: 

Any update on this, Ivan? I'd love to get out an 1.5 beta this year! (the sooner the better)

Simon Goldschmidt <goldsimon>
Group administrator
Tue 15 Jan 2013 06:43:25 PM UTC, comment #3: 

Yes and Yes.

I will add the filter call to the ethernetif.c skeleton.

Same with enabling autoconfig. Plus a macro to enable autoconfig in the netif.

Ivan Delamer <idelamer>
Group Member
Tue 15 Jan 2013 06:39:16 PM UTC, comment #2: 

Regarding the multicast filters, I guess I'm with Ivan. Unfortunately, I'm not too familiar with IPv6, yet, but I'd rather solve this with good documentation (and an example driver making everything right, probably - is there any?) than calling a filter-add-function right after adding the netif.

As to the second part, I'd strongly suggest to add a function or function-like define to handle 'ip6_autoconfig_enabled'. 'User' code should NEVER directly access struct members (in order to give us the liberty of changing the structs in the future).

Simon Goldschmidt <goldsimon>
Group administrator
Wed 09 Jan 2013 08:52:57 PM UTC, comment #1: 

Hi Grant,

Thank you for reporting this. Lets discuss whether it is actually a bug or your steps are necessary.

Nodes must always accept packets addressed to ff02::1. This is not handled my the multicast system as this group membership is not reported. So this must be enabled at the MAC level during initialization, as you have done. This is the case even when MLD is not enabled: SLAAC should still work, but it is up to the user to enable the filter for all-nodes LL and also for the autoconfigured LL address.

In the second part of your post, for creating a LL address and enabling SLACC, I don't believe this should be done internally. SLAAC must be enabled per netif, as it is not always desirable in all netifs (e.g. think PPP netif). Likewise, the creation of a LL address depends on the MAC type and therefore can't be done automatically. There is a helper method for IEEE 802.3 type MAC addresses, but that's again as far as you can go. Think PPP as an example again.

I'm leaving the bug as open for now, waiting for some more opinions.

Cheers
Ivan

Ivan Delamer <idelamer>
Group Member
Sat 29 Dec 2012 12:21:51 AM UTC, original submission:  

More progress on IPv6 to report. I added the following to my platform initialization function:

@@ -145,7 +180,20 @@ static void host_hardware_init(struct netif *netif)
#endif
#if LWIP_IPV6 && LWIP_IPV6_MLD
     netif->mld_mac_filter = host_mld_mac_filter;
-#endif
+#if LWIP_IPV6_AUTOCONFIG
+    // Ensure that any interface supporting IPv6 is subscribed to the
+    // link-local all-nodes address (ff02::1) such that it picks up
+    // router advertisements for stateless address auto-configuration
+    // (SLAAC).
+    {
+        ip6_addr_t allnodes_linklocal;
+       
+        ip6_addr_set_allnodes_linklocal(&allnodes_linklocal);
+
+        host_mld_mac_filter(netif, &allnodes_linklocal, MLD6_ADD_MAC_FILTER);
+    }
+#endif // LWIP_IPV6_AUTOCONFIG
+#endif // LWIP_IPV6 && LWIP_IPV6_MLD

and I now correctly receive a SLAAC address based on router advertisements:

> ip addr show
1: en0: <BROADCAST,UP,LOWER_UP,> mtu 1536
    link/ether 02:28:3e:3d:43:47 brd ff:ff:ff:ff:ff:ff
    inet 10.2.1.28/16 brd 10.2.255.255 scope global en0
    inet6 FE80::0228:3EFF:FE3D:4347/64 scope link
    inet6 FDCB:6364:780D:D6A1:0228:3EFF:FE3D:4347/64 scope unique

and can ping6 the address from Linux:

% ping6 -c 4 FDCB:6364:780D:D6A1:0228:3EFF:FE3D:4347
PING FDCB:6364:780D:D6A1:0228:3EFF:FE3D:4347(fdcb:6364:780d:d6a1:0228:3eff:fe3d:4347) 56 data bytes
64 bytes from fdcb:6364:780d:d6a1:0228:3eff:fe3d:4347: icmp_seq=1 ttl=255 time=91.1 ms
64 bytes from fdcb:6364:780d:d6a1:0228:3eff:fe3d:4347: icmp_seq=2 ttl=255 time=98.1 ms
64 bytes from fdcb:6364:780d:d6a1:0228:3eff:fe3d:4347: icmp_seq=3 ttl=255 time=4.46 ms
64 bytes from fdcb:6364:780d:d6a1:0228:3eff:fe3d:4347: icmp_seq=4 ttl=255 time=14.2 ms

--- FDCB:6364:780D:D6A1:0228:3EFF:FE3D:4347 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 4.467/51.981/98.148/42.855 ms

and can ping6 Linux back:

> ping6 -c 4 fdcb:6364:780d:d6a1:20c:29ff:fe15:eeb8
PING fdcb:6364:780d:d6a1:20c:29ff:fe15:eeb8 (FDCB:6364:780D:D6A1:20C:29FF:FE15:EEB8): 56(104) bytes of data
64 bytes from fdcb:6364:780d:d6a1:20c:29ff:fe15:eeb8 (FDCB:6364:780D:D6A1:20C:29FF:FE15:EEB8): icmp_seq=1 ttl=64
64 bytes from fdcb:6364:780d:d6a1:20c:29ff:fe15:eeb8 (FDCB:6364:780D:D6A1:20C:29FF:FE15:EEB8): icmp_seq=2 ttl=64
64 bytes from fdcb:6364:780d:d6a1:20c:29ff:fe15:eeb8 (FDCB:6364:780D:D6A1:20C:29FF:FE15:EEB8): icmp_seq=3 ttl=64
64 bytes from fdcb:6364:780d:d6a1:20c:29ff:fe15:eeb8 (FDCB:6364:780D:D6A1:20C:29FF:FE15:EEB8): icmp_seq=4 ttl=64

--- fdcb:6364:780d:d6a1:20c:29ff:fe15:eeb8 ping statistics ---
4 packets transmitted, 4 received, 0 duplicates, 0 errors 0% packet loss, time 5054ms
round-trip min/avg/max = 0.000/1012.000/253.000 ms

It seems as though the patched block above should be within the IPv6 core stack of LwIP itself rather than being in the platform support glue, much as I'd argue for the netif_create_ip6_linklocal_address() call following netif_add().

Setting LWIP_IPV6_AUTOCONFIG clearly isn't enough to get SLAAC working. At minimum:

1) The above diff
2) The below diff:

+#if LWIP_IPV6
+    // Establish an IPv6 link-local address
+
+    netif_create_ip6_linklocal_address(&my_if, 1);
+#if LWIP_IPV6_AUTOCONFIG
+    my_if.ip6_autoconfig_enabled = 1;
+#endif
+#endif

   after netif_add().

are required.

Grant Erickson <marathon96>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by idelamer (Posted a comment)
  • -email is unavailable- added by marathon96 (Submitted the item)
  • -email is unavailable- added by marathon96
  •  

    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.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-18 idelamer StatusNone Fixed
        Open/ClosedOpen Closed
    2013-06-28 goldsimon Planned Release 1.5.0 beta1
    2013-01-09 idelamer Assigned toNone idelamer
    2012-12-29 marathon96 Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code