summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorStephen Hemminger2005-05-04 01:24:03 +0200
committerDavid S. Miller2005-05-04 01:24:03 +0200
commit8cbe1d46d69f9e2c49f284fe0e9aee3387bd2c71 (patch)
treeb9d25110d46551fa80a2c34e1b9147f855e43e41 /net/sched
parent[NETFILTER]: Drop conntrack reference in ip_dev_loopback_xmit() (diff)
downloadkernel-qcow2-linux-8cbe1d46d69f9e2c49f284fe0e9aee3387bd2c71.tar.gz
kernel-qcow2-linux-8cbe1d46d69f9e2c49f284fe0e9aee3387bd2c71.tar.xz
kernel-qcow2-linux-8cbe1d46d69f9e2c49f284fe0e9aee3387bd2c71.zip
[PKT_SCHED]: netetm: trap infinite loop hange on qlen underflow
Due to bugs in netem (fixed by later patches), it is possible to get qdisc qlen to go negative. If this happens the CPU ends up spinning forever in qdisc_run(). So add a BUG_ON() to trap it. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_generic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 9a2f8e41a26e..87e48a4e1051 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -179,6 +179,7 @@ requeue:
netif_schedule(dev);
return 1;
}
+ BUG_ON((int) q->q.qlen < 0);
return q->q.qlen;
}