From: Li Wei Date: Mon, 18 Jun 2012 06:33:38 +0000 (+0800) Subject: tc: prio: Perform more strict check on priomap. X-Git-Tag: v3.5.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c4f545633dc0aa812ea77a5036c50bce2a108e7;p=thirdparty%2Fiproute2.git tc: prio: Perform more strict check on priomap. Since band number counts from zero thus band must be little than opt.bands. --- diff --git a/tc/q_prio.c b/tc/q_prio.c index 79b4fd092..bacc70246 100644 --- a/tc/q_prio.c +++ b/tc/q_prio.c @@ -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"); return -1; } - if (band > opt.bands) { + if (band >= opt.bands) { fprintf(stderr, "\"priomap\" element is out of bands\n"); return -1; }