]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: prio: Perform more strict check on priomap.
authorLi Wei <lw@cn.fujitsu.com>
Mon, 18 Jun 2012 06:33:38 +0000 (14:33 +0800)
committerStephen Hemminger <shemminger@vyatta.com>
Mon, 18 Jun 2012 19:25:08 +0000 (12:25 -0700)
Since band number counts from zero thus band must be little than
opt.bands.

tc/q_prio.c

index 79b4fd0926d2396bc03d1666d207546900eed349..bacc70246d537eabf39e4f0649a1764ae48ac135 100644 (file)
@@ -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;
                        }