[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] IPv6: Ensuring Router Advertisements and SLAAC Work
From: |
Ivan Delamer |
Subject: |
Re: [lwip-devel] IPv6: Ensuring Router Advertisements and SLAAC Work |
Date: |
Fri, 28 Dec 2012 13:22:02 -0700 (MST) |
User-agent: |
SquirrelMail/1.4.9a |
Hi Grant,
The link-local all-nodes address is automatically subscribed to, but I
don't remember if a call to mld_mac_filter is made or not.
If not, please add it as a bug so that it is not forgotten, I'll fix it
when I return from holidays in a couple weeks.
Cheers
Ivan
On Thu, December 27, 2012 16:48, Grant Erickson wrote:
> Ivan,
>
> More progress on IPv6 to report. I added the following to my
> 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.