netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: fq_codel: Fix off-by-one error
@ 2013-03-28 23:52 Vijay Subramanian
  2013-03-29 15:01 ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Vijay Subramanian @ 2013-03-28 23:52 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, Vijay Subramanian

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 <subramanian.vijay@gmail.com>
---
 net/sched/sch_fq_codel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 4e606fc..5578628 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++;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-03-30 15:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 23:52 [PATCH net] net: fq_codel: Fix off-by-one error Vijay Subramanian
2013-03-29 15:01 ` Eric Dumazet
2013-03-29 19:33   ` David Miller
2013-03-29 21:49   ` Vijay Subramanian
2013-03-30  6:53   ` Markus Trippelsdorf
2013-03-30 14:42     ` Eric Dumazet
2013-03-30 15:08       ` Markus Trippelsdorf
2013-03-30 15:28         ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).