[PATCH] tc: prio: Perform more strict check on priomap.

Subsystems: the rest

STALE5210d

2 messages, 2 authors, 2012-06-18 · open the first message on its own page

[PATCH] tc: prio: Perform more strict check on priomap.

From: Li Wei <hidden>
Date: 2012-06-18 06:34:13

Since band number counts from zero thus band must be little than
opt.bands.
---
 tc/q_prio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tc/q_prio.c b/tc/q_prio.c
index 79b4fd0..bacc702 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;
 			}
-- 
1.7.1

Re: [PATCH] tc: prio: Perform more strict check on priomap.

From: Stephen Hemminger <hidden>
Date: 2012-06-18 19:25:57

On Mon, 18 Jun 2012 14:33:38 +0800
Li Wei [off-list ref] wrote:
quoted hunk
Since band number counts from zero thus band must be little than
opt.bands.
---
 tc/q_prio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tc/q_prio.c b/tc/q_prio.c
index 79b4fd0..bacc702 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;
 			}
Applied
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help