Skip to content

Commit

Permalink
[PKT_SCHED]: netetm: trap infinite loop hange on qlen underflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed May 3, 2005
1 parent bd96535 commit 8cbe1d4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ int qdisc_restart(struct net_device *dev)
netif_schedule(dev);
return 1;
}
BUG_ON((int) q->q.qlen < 0);
return q->q.qlen;
}

Expand Down

0 comments on commit 8cbe1d4

Please sign in to comment.