Skip to content

Commit 1469521

Browse files
edumazetdavem330
authored andcommitted
fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
My intent was to not let users set a zero drop_batch_size, it seems I once again messed with min()/max(). Fixes: 9d18562 ("fq_codel: add batch ability to fq_codel_drop()") Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 62b4011 commit 1469521

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/sch_fq_codel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt,
416416
q->quantum = max(256U, nla_get_u32(tb[TCA_FQ_CODEL_QUANTUM]));
417417

418418
if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])
419-
q->drop_batch_size = min(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]));
419+
q->drop_batch_size = max(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]));
420420

421421
if (tb[TCA_FQ_CODEL_MEMORY_LIMIT])
422422
q->memory_limit = min(1U << 31, nla_get_u32(tb[TCA_FQ_CODEL_MEMORY_LIMIT]));

0 commit comments

Comments
 (0)