tc: prio: Perform more strict check on priomap.
Since band number counts from zero thus band must be little than opt.bands.
This commit is contained in:
parent
8c8a9089ba
commit
3c4f545633
|
|
@ -67,7 +67,7 @@ static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
|
||||||
fprintf(stderr, "Illegal \"priomap\" element\n");
|
fprintf(stderr, "Illegal \"priomap\" element\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (band > opt.bands) {
|
if (band >= opt.bands) {
|
||||||
fprintf(stderr, "\"priomap\" element is out of bands\n");
|
fprintf(stderr, "\"priomap\" element is out of bands\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue