netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tc: prio: Perform more strict check on priomap.
@ 2012-06-18  6:33 Li Wei
  2012-06-18 19:25 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Li Wei @ 2012-06-18  6:33 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger


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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-18 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-18  6:33 [PATCH] tc: prio: Perform more strict check on priomap Li Wei
2012-06-18 19:25 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).