]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PKT_SCHED]: Qdisc drop operation is optional
authorPatrick McHardy <kaber@trash.net>
Tue, 21 Mar 2006 03:00:49 +0000 (19:00 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 03:00:49 +0000 (19:00 -0800)
The drop operation is optional and qdiscs must check if childs support it.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_netem.c
net/sched/sch_prio.c
net/sched/sch_tbf.c

index ba528320483743dc0ef028b8e5bf08d981efbbf8..7228d30512c79466675276933268b6dcfc31972e 100644 (file)
@@ -252,9 +252,9 @@ static int netem_requeue(struct sk_buff *skb, struct Qdisc *sch)
 static unsigned int netem_drop(struct Qdisc* sch)
 {
        struct netem_sched_data *q = qdisc_priv(sch);
-       unsigned int len;
+       unsigned int len = 0;
 
-       if ((len = q->qdisc->ops->drop(q->qdisc)) != 0) {
+       if (q->qdisc->ops->drop && (len = q->qdisc->ops->drop(q->qdisc)) != 0) {
                sch->q.qlen--;
                sch->qstats.drops++;
        }
index 1641db33a994020f557cee3d42ab0cc5505a2743..3395ca7bcadfa76e3200e45cddf7944081965031 100644 (file)
@@ -165,7 +165,7 @@ static unsigned int prio_drop(struct Qdisc* sch)
 
        for (prio = q->bands-1; prio >= 0; prio--) {
                qdisc = q->queues[prio];
-               if ((len = qdisc->ops->drop(qdisc)) != 0) {
+               if (qdisc->ops->drop && (len = qdisc->ops->drop(qdisc)) != 0) {
                        sch->q.qlen--;
                        return len;
                }
index cb9711ea8c6cac3a4f2c4f568a454fadfd30287a..e9e473457361f437b9021177acd1f139b17bbb07 100644 (file)
@@ -177,9 +177,9 @@ static int tbf_requeue(struct sk_buff *skb, struct Qdisc* sch)
 static unsigned int tbf_drop(struct Qdisc* sch)
 {
        struct tbf_sched_data *q = qdisc_priv(sch);
-       unsigned int len;
+       unsigned int len = 0;
 
-       if ((len = q->qdisc->ops->drop(q->qdisc)) != 0) {
+       if (q->qdisc->ops->drop && (len = q->qdisc->ops->drop(q->qdisc)) != 0) {
                sch->q.qlen--;
                sch->qstats.drops++;
        }