aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorMitsuru Chinen <mitch@linux.vnet.ibm.com>2007-10-10 05:53:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:52 -0400
commitf24e3d658cf382f11a7aa7887fa99147bdc6fe0b (patch)
tree605da52f1261eaa847adc8d2d048085692355ace /net/ipv6/addrconf.c
parent9b7726523523472ead660b1d45df29dcaf6cc5c0 (diff)
[IPV6]: Defer IPv6 device initialization until a valid qdisc is specified
To judge the timing for DAD, netif_carrier_ok() is used. However, there is a possibility that dev->qdisc stays noop_qdisc even if netif_carrier_ok() returns true. In that case, DAD NS is not sent out. We need to defer the IPv6 device initialization until a valid qdisc is specified. Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8b2d760ddf26..52d10d213217 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -74,6 +74,7 @@
74#include <net/tcp.h> 74#include <net/tcp.h>
75#include <net/ip.h> 75#include <net/ip.h>
76#include <net/netlink.h> 76#include <net/netlink.h>
77#include <net/pkt_sched.h>
77#include <linux/if_tunnel.h> 78#include <linux/if_tunnel.h>
78#include <linux/rtnetlink.h> 79#include <linux/rtnetlink.h>
79 80
@@ -213,6 +214,12 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
213const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; 214const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
214const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; 215const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
215 216
217/* Check if a valid qdisc is available */
218static inline int addrconf_qdisc_ok(struct net_device *dev)
219{
220 return (dev->qdisc != &noop_qdisc);
221}
222
216static void addrconf_del_timer(struct inet6_ifaddr *ifp) 223static void addrconf_del_timer(struct inet6_ifaddr *ifp)
217{ 224{
218 if (del_timer(&ifp->timer)) 225 if (del_timer(&ifp->timer))
@@ -384,7 +391,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
384 } 391 }
385#endif 392#endif
386 393
387 if (netif_running(dev) && netif_carrier_ok(dev)) 394 if (netif_running(dev) && addrconf_qdisc_ok(dev))
388 ndev->if_flags |= IF_READY; 395 ndev->if_flags |= IF_READY;
389 396
390 ipv6_mc_init_dev(ndev); 397 ipv6_mc_init_dev(ndev);
@@ -2283,7 +2290,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2283 break; 2290 break;
2284 2291
2285 if (event == NETDEV_UP) { 2292 if (event == NETDEV_UP) {
2286 if (!netif_carrier_ok(dev)) { 2293 if (!addrconf_qdisc_ok(dev)) {
2287 /* device is not ready yet. */ 2294 /* device is not ready yet. */
2288 printk(KERN_INFO 2295 printk(KERN_INFO
2289 "ADDRCONF(NETDEV_UP): %s: " 2296 "ADDRCONF(NETDEV_UP): %s: "
@@ -2295,7 +2302,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
2295 if (idev) 2302 if (idev)
2296 idev->if_flags |= IF_READY; 2303 idev->if_flags |= IF_READY;
2297 } else { 2304 } else {
2298 if (!netif_carrier_ok(dev)) { 2305 if (!addrconf_qdisc_ok(dev)) {
2299 /* device is still not ready. */ 2306 /* device is still not ready. */
2300 break; 2307 break;
2301 } 2308 }