--- todevice.cc	2006-05-31 14:20:44.000000000 +0000
+++ todevice.cc.new	2006-05-31 14:22:37.000000000 +0000
@@ -229,11 +229,13 @@ ToDevice::cleanup(CleanupStage stage)
 bool
 ToDevice::run_task()
 {
-    int busy;
+    int busy = 0;
     int sent = 0;
 
     _runs++;
 
+	int carrier_ok = netif_carrier_ok(_dev);
+
 #if LINUX_VERSION_CODE >= 0x020400
     local_bh_disable();
     if (!spin_trylock(&_dev->xmit_lock)) {
@@ -271,7 +273,7 @@ ToDevice::run_task()
 #endif
   
     /* try to send from click */
-    while (sent < _burst && (busy = netif_queue_stopped(_dev)) == 0) {
+    while (carrier_ok && sent < _burst && (busy = netif_queue_stopped(_dev)) == 0) {
 #if CLICK_DEVICE_THESIS_STATS && !CLICK_DEVICE_STATS
 	uint64_t before_pull_cycles = click_get_cycles();
 #endif
@@ -348,10 +350,11 @@ ToDevice::run_task()
     // the transmit ring.
     // Otherwise, don't go to sleep if the signal isn't active and
     // we didn't just send any packets
+
 #ifdef HAVE_CLICK_KERNEL_TX_NOTIFY
-    bool reschedule = ((!busy) && (sent > 0 || _signal.active()));
+    bool reschedule = ((carrier_ok) && (!busy) && (sent > 0 || _signal.active()));
 #else 
-    bool reschedule = (busy || sent > 0 || _signal.active());
+    bool reschedule = ((carrier_ok) && (busy || sent > 0 || _signal.active()));
 #endif
 #if HAVE_LINUX_POLLING
     reschedule |= is_polling;
@@ -426,13 +429,26 @@ device_notifier_hook(struct notifier_blo
 	flags = NETDEV_DOWN;
 #endif
     if (flags == NETDEV_DOWN || flags == NETDEV_UP) {
-	bool down = (flags == NETDEV_DOWN);
-	net_device *dev = (net_device *)v;
-	Vector<AnyDevice *> es;
-	to_device_map.lookup_all(dev, down, es);
-	for (int i = 0; i < es.size(); i++)
-	    ((ToDevice *)(es[i]))->change_device(down ? 0 : dev);
-    }
+		bool down = (flags == NETDEV_DOWN);
+		net_device *dev = (net_device *)v;
+
+		Vector<AnyDevice *> es;
+		to_device_map.lookup_all(dev, down, es);
+
+		for (int i = 0; i < es.size(); i++)
+			((ToDevice *)(es[i]))->change_device(down ? 0 : dev);
+
+    } else {
+		Vector<AnyDevice *> es;
+		net_device *dev = (net_device *)v;
+
+		to_device_map.lookup_all(dev, true, es);
+
+		for (int i = 0; i < es.size(); i++) {
+			ToDevice* todevice = ((ToDevice *)(es[i]));
+			todevice->tx_wake_queue(dev);
+		}
+	}
     return 0;
 }
 }
