]> err.no Git - linux-2.6/blobdiff - net/core/link_watch.c
[PATCH] sunrpc: cache_register can use wrong module reference
[linux-2.6] / net / core / link_watch.c
index 4859b7446c6fce484b92d53a853b0a5c9e31d02e..d43d1201275c19bf7aaf5a45126586d01b0f3960 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/netdevice.h>
 #include <linux/if.h>
 #include <net/sock.h>
+#include <net/pkt_sched.h>
 #include <linux/rtnetlink.h>
 #include <linux/jiffies.h>
 #include <linux/spinlock.h>
@@ -74,6 +75,12 @@ void linkwatch_run_queue(void)
                clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state);
 
                if (dev->flags & IFF_UP) {
+                       if (netif_carrier_ok(dev)) {
+                               WARN_ON(dev->qdisc_sleeping == &noop_qdisc);
+                               dev_activate(dev);
+                       } else
+                               dev_deactivate(dev);
+
                        netdev_state_change(dev);
                }