From: Herbert Xu Date: Tue, 27 Mar 2007 21:31:52 +0000 (-0700) Subject: [IPV6]: Set IF_READY if the device is up and has carrier X-Git-Tag: v2.6.21-rc6~82^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53aadcc90931dfa150f76ce9a5f9e8f3e43d57df;p=linux-2.6 [IPV6]: Set IF_READY if the device is up and has carrier We still need to set the IF_READY flag in ipv6_add_dev for the case where all addresses (including the link-local) are deleted and then recreated. In that case the IPv6 device too will be destroyed and then recreated. In order to prevent the original problem, we simply ensure that the device is up before setting IF_READY. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 1b616992d9..7552663aa1 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -342,6 +342,9 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) } #endif + if (netif_running(dev) && netif_carrier_ok(dev)) + ndev->if_flags |= IF_READY; + ipv6_mc_init_dev(ndev); ndev->tstamp = jiffies; #ifdef CONFIG_SYSCTL