From: Vijay Subramanian Date: Thu, 28 Mar 2013 13:52:00 +0000 (+0000) Subject: net: fq_codel: Fix off-by-one error X-Git-Tag: v3.8.6~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fd7016c4656e5f83853bed6f2d84bd61368a7b02;p=karo-tx-linux.git net: fq_codel: Fix off-by-one error [ Upstream commit cd68ddd4c29ab523440299f24ff2417fe7a0dca6 ] Currently, we hold a max of sch->limit -1 number of packets instead of sch->limit packets. Fix this off-by-one error. Signed-off-by: Vijay Subramanian Acked-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index 4e606fcb2534..55786283a3df 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -195,7 +195,7 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch) flow->deficit = q->quantum; flow->dropped = 0; } - if (++sch->q.qlen < sch->limit) + if (++sch->q.qlen <= sch->limit) return NET_XMIT_SUCCESS; q->drop_overlimit++;