Default route for link local address is configured automatically if NETWORKING_IPV6=yes is in ifcfg-eth*. When the route table for the interface is flushed and a new address is added to the same device, default route for link local address has to added by default. This issue was caught with default address selection, TAHI Conformance test , test #4 and check #07. -bash-4.2# uname -a Linux localhost 3.10.11 #1 SMP Wed Sep 25 15:50:00 CDT 2013 p pc64 ppc64 ppc64 GNU/Linux ==> LLA route available for eth2 -bash-4.2# ip -6 route list dev eth2 fe80::/64 proto kernel metric 256 ==> Flush all routes for eth2(IPv6) -bash-4.2# ip -6 -s -s route flush dev eth2 fe80::/64 proto kernel metric 256 *** Round 1, deleting 1 entries *** *** Flush is complete after 1 round *** ==> Add an IPv6 address -bash-4.2# ifconfig eth2 inet6 add 3ffe::1/64 ==> LLA route should have added along with 3ffe -bash-4.2# ip -6 route list dev eth2 3ffe::/64 proto kernel metric 256 For reference, behaviour kernel 2.6.32: [root@localhost ~]# ip -6 route list dev eth0 fe80::/64 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295 [root@localhost ~]# ip -6 -statistics -statistics route flush dev eth0 fe80::/64 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295 *** Round 1, deleting 1 entries *** *** Flush is complete after 1 round *** [root@localhost ~]# ip -6 route list dev eth0 [root@localhost ~]# ifconfig eth0 inet6 add 3ffe::1/64 [root@localhost ~]# ip -6 route list dev eth0 3ffe::/64 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295 fe80::/64 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295 1042 root@localhost ~ # uname -a Linux localhost 2.6.32 #1 SMP Sun Mar 31 23:02:26 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux
I have found the issue to be caused by this checkin http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/net/ipv6?id=62b54dd91567686a1cb118f76a72d5f4764a86dd According to this change : He removes adding a link local route if any other address is added , applicable across all interface though he mentioned only lo interface
I have found the following change fixes this issue diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index f62c72b..a8a4df9 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -1763,6 +1763,16 @@ static int addrconf_ifid_infiniband(u8 *eui, struct net_device *dev) return 0; } +static void addrconf_add_lroute(struct net_device *dev) +{ + struct in6_addr addr; + + ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0); + addrconf_prefix_route(&addr, 64, dev, 0, 0); +} + + + static int __ipv6_isatap_ifid(u8 *eui, __be32 addr) { if (addr == 0) @@ -2010,8 +2020,10 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev) return ERR_PTR(-EACCES); /* Add default multicast route */ - if (!(dev->flags & IFF_LOOPBACK)) + if (!(dev->flags & IFF_LOOPBACK)){ addrconf_add_mroute(dev); + addrconf_add_lroute(dev); + } return idev; } I have sent a patch accordingly on the lkml list
Hi! Could you raise this issue on netdev@vger.kernel.org along with your patch and Cc the author of the patch? IMHO it looks good. Thanks!
Hi , Thanks I had sent CC to author of the earlier code and he has CCed to netdev. I have just replied to his queries. Thanks