# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1291 -> 1.1292 # net/ipv6/addrconf.c 1.64 -> 1.65 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/01 vnuorval@xxxxxxxxxxxxxxxxxxxxxxx 1.1292 # Autoconfigure a link-local address to all IPv6 tunnel devices # -------------------------------------------- # diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c --- a/net/ipv6/addrconf.c Mon Sep 1 16:56:39 2003 +++ b/net/ipv6/addrconf.c Mon Sep 1 16:56:39 2003 @@ -1820,6 +1820,39 @@ #if defined(CONFIG_IPV6_TUNNEL) || defined(CONFIG_IPV6_TUNNEL_MODULE) + +/* + * Autoconfigure tunnel with a link-local address so routing protocols, + * DHCPv6, MLD etc. can be run over the virtual link + */ + +static void ip6_tnl_add_linklocal(struct inet6_dev *idev) +{ + struct in6_addr addr; + struct net_device *dev; + ASSERT_RTNL(); + + memset(&addr, 0, sizeof(struct in6_addr)); + addr.s6_addr32[0] = htonl(0xFE800000); + + /* try to inherit EUI64 from another device */ + for (dev = dev_base; dev; dev = dev->next) { + if (!ipv6_generate_eui64(addr.s6_addr + 8, dev)) { + addrconf_add_linklocal(idev, &addr); + return; + } + } +#ifdef CONFIG_IPV6_PRIVACY + /* else try to generate a random identifier */ + if (!__ipv6_regen_rndid(idev)) { + memcpy(addr.s6_addr + 8, idev->rndid, 8); + addrconf_add_linklocal(idev, &addr); + return; + } +#endif + printk(KERN_DEBUG "init ip6-ip6: add_linklocal failed\n"); +} + static void addrconf_ip6_tnl_config(struct net_device *dev) { struct inet6_dev *idev; @@ -1830,6 +1863,8 @@ printk(KERN_DEBUG "init ip6-ip6: find_dev failed\n"); return; } + ip6_tnl_add_linklocal(idev); + addrconf_add_mroute(dev); } #endif @@ -2135,6 +2170,7 @@ if (ifp->idev->cnf.forwarding == 0 && (dev->flags&IFF_LOOPBACK) == 0 && + dev->type != ARPHRD_TUNNEL6 && (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { struct in6_addr all_routers;