]> err.no Git - linux-2.6/blobdiff - net/sched/sch_generic.c
[NET]: Make sure l_linger is unsigned to avoid negative timeouts
[linux-2.6] / net / sched / sch_generic.c
index 73e218e646acea7a0c998831cf1e8564dd42ef29..99ceb91f0150a158aa926c3c3ebeb13d1860cbd4 100644 (file)
@@ -238,6 +238,20 @@ static void dev_watchdog_down(struct net_device *dev)
        spin_unlock_bh(&dev->xmit_lock);
 }
 
+void netif_carrier_on(struct net_device *dev)
+{
+       if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state))
+               linkwatch_fire_event(dev);
+       if (netif_running(dev))
+               __netdev_watchdog_up(dev);
+}
+
+void netif_carrier_off(struct net_device *dev)
+{
+       if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state))
+               linkwatch_fire_event(dev);
+}
+
 /* "NOOP" scheduler: the best scheduler, recommended for all interfaces
    under all circumstances. It is difficult to invent anything faster or
    cheaper.
@@ -331,11 +345,10 @@ static struct sk_buff *pfifo_fast_dequeue(struct Qdisc* qdisc)
        int prio;
        struct sk_buff_head *list = qdisc_priv(qdisc);
 
-       for (prio = 0; prio < PFIFO_FAST_BANDS; prio++, list++) {
-               struct sk_buff *skb = __qdisc_dequeue_head(qdisc, list);
-               if (skb) {
+       for (prio = 0; prio < PFIFO_FAST_BANDS; prio++) {
+               if (!skb_queue_empty(list + prio)) {
                        qdisc->q.qlen--;
-                       return skb;
+                       return __qdisc_dequeue_head(qdisc, list + prio);
                }
        }
 
@@ -439,6 +452,7 @@ struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops)
        if (!ops->init || ops->init(sch, NULL) == 0)
                return sch;
 
+       qdisc_destroy(sch);
 errout:
        return NULL;
 }
@@ -600,6 +614,8 @@ void dev_shutdown(struct net_device *dev)
 }
 
 EXPORT_SYMBOL(__netdev_watchdog_up);
+EXPORT_SYMBOL(netif_carrier_on);
+EXPORT_SYMBOL(netif_carrier_off);
 EXPORT_SYMBOL(noop_qdisc);
 EXPORT_SYMBOL(noop_qdisc_ops);
 EXPORT_SYMBOL(qdisc_create_dflt);