[IPV6]: Run DAD when the link becomes ready.

If the link was not available when the interface was created,
run DAD for pending tentative addresses when the link becomes ready.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

+23
+23
net/ipv6/addrconf.c
··· 137 static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); 138 static void addrconf_dad_timer(unsigned long data); 139 static void addrconf_dad_completed(struct inet6_ifaddr *ifp); 140 static void addrconf_rs_timer(unsigned long data); 141 static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); 142 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); ··· 419 if ((idev = ipv6_add_dev(dev)) == NULL) 420 return NULL; 421 } 422 if (dev->flags&IFF_UP) 423 ipv6_mc_up(idev); 424 return idev; ··· 2142 { 2143 struct net_device *dev = (struct net_device *) data; 2144 struct inet6_dev *idev = __in6_dev_get(dev); 2145 2146 switch(event) { 2147 case NETDEV_UP: ··· 2175 "link becomes ready\n", 2176 dev->name); 2177 2178 } 2179 2180 switch(dev->type) { ··· 2194 break; 2195 }; 2196 if (idev) { 2197 /* If the MTU changed during the interface down, when the 2198 interface up, the changed MTU must be reflected in the 2199 idev as well as routers. ··· 2551 addrconf_mod_timer(ifp, AC_RS, ifp->idev->cnf.rtr_solicit_interval); 2552 spin_unlock_bh(&ifp->lock); 2553 } 2554 } 2555 2556 #ifdef CONFIG_PROC_FS
··· 137 static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); 138 static void addrconf_dad_timer(unsigned long data); 139 static void addrconf_dad_completed(struct inet6_ifaddr *ifp); 140 + static void addrconf_dad_run(struct inet6_dev *idev); 141 static void addrconf_rs_timer(unsigned long data); 142 static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); 143 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); ··· 418 if ((idev = ipv6_add_dev(dev)) == NULL) 419 return NULL; 420 } 421 + 422 if (dev->flags&IFF_UP) 423 ipv6_mc_up(idev); 424 return idev; ··· 2140 { 2141 struct net_device *dev = (struct net_device *) data; 2142 struct inet6_dev *idev = __in6_dev_get(dev); 2143 + int run_pending = 0; 2144 2145 switch(event) { 2146 case NETDEV_UP: ··· 2172 "link becomes ready\n", 2173 dev->name); 2174 2175 + run_pending = 1; 2176 } 2177 2178 switch(dev->type) { ··· 2190 break; 2191 }; 2192 if (idev) { 2193 + if (run_pending) 2194 + addrconf_dad_run(idev); 2195 + 2196 /* If the MTU changed during the interface down, when the 2197 interface up, the changed MTU must be reflected in the 2198 idev as well as routers. ··· 2544 addrconf_mod_timer(ifp, AC_RS, ifp->idev->cnf.rtr_solicit_interval); 2545 spin_unlock_bh(&ifp->lock); 2546 } 2547 + } 2548 + 2549 + static void addrconf_dad_run(struct inet6_dev *idev) { 2550 + struct inet6_ifaddr *ifp; 2551 + 2552 + read_lock_bh(&idev->lock); 2553 + for (ifp = idev->addr_list; ifp; ifp = ifp->if_next) { 2554 + spin_lock_bh(&ifp->lock); 2555 + if (!(ifp->flags & IFA_F_TENTATIVE)) { 2556 + spin_unlock_bh(&ifp->lock); 2557 + continue; 2558 + } 2559 + spin_unlock_bh(&ifp->lock); 2560 + addrconf_dad_kick(ifp); 2561 + } 2562 + read_unlock_bh(&idev->lock); 2563 } 2564 2565 #ifdef CONFIG_PROC_FS