Skip to content

Commit

Permalink
net: fq_codel: Fix off-by-one error
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
subrav authored and davem330 committed Mar 29, 2013
1 parent e6c3827 commit cd68ddd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_fq_codel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit cd68ddd

Please sign in to comment.