fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks
Subsystems (3)
PATCH v2 1/1 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 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")
Signed-off-by Eric Dumazet <[email protected]>
--- net/sched/sch_fq_codel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_fq_codel.c +1 -1
@@ -416,7 +416,7 @@ static int fq_codel_change(struct Qdisc *sch, struct nlattr *opt, q->quantum =max (256U ,nla_get_u32 (tb[TCA_FQ_CODEL_QUANTUM ]));if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ]) - q->drop_batch_size =min (1U ,nla_get_u32 (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ])); + q->drop_batch_size =max (1U ,nla_get_u32 (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE ]));if (tb[TCA_FQ_CODEL_MEMORY_LIMIT ]) q->memory_limit =min (1U <<31 ,nla_get_u32 (tb[TCA_FQ_CODEL_MEMORY_LIMIT ]));
Signature · 1 line
2.26.2.303.gf8c07b1a785-goog
Quoted 5 lines · Eric Dumazet
My intent was to not let users set a zero
drop_batch_size, it seems I once again messed with min()/max().Fixes 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")Signed-off-by Eric Dumazet <[email protected]>
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Sat, 25 Apr 2020 12:40:25 -0700
Quoted 5 lines
My intent was to not let users set a zero
drop_batch_size, it seems I once again messed with min()/max().Fixes 9d18562a2278 ("fq_codel: add batch ability to fq_codel_drop()")Signed-off-by Eric Dumazet <[email protected]>
Applied and queued up for -stable, thanks.