Netdev List
 help / color / mirror / Atom feed
From: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
To: stephen.hemminger@vyatta.com
Cc: netdev@vger.kernel.org
Subject: [PATCH] [TC U32] Fix input parsing to support more than 9 flow id's correctly
Date: Tue, 12 Feb 2008 11:37:25 -0800	[thread overview]
Message-ID: <20080212193725.4137.62287.stgit@localhost.localdomain> (raw)

From: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>

Using strtoul with a base of 16 converts flowid 10 into 0x10, which makes
it flowid 16.  This is interpreted by the kernel incorrectly, and causes
traffic flows above 9 to be classified into band 0 on multiband qdiscs.
This changes the base to 10, which will correctly parse input into the
proper hexidecimal value.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---

 tc/tc_util.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tc/tc_util.c b/tc/tc_util.c
index cdbae42..a277eac 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -65,7 +65,7 @@ int get_tc_classid(__u32 *h, const char *str)
 	maj = TC_H_UNSPEC;
 	if (strcmp(str, "none") == 0)
 		goto ok;
-	maj = strtoul(str, &p, 16);
+	maj = strtoul(str, &p, 10);
 	if (p == str) {
 		maj = 0;
 		if (*p != ':')
@@ -76,7 +76,7 @@ int get_tc_classid(__u32 *h, const char *str)
 			return -1;
 		maj <<= 16;
 		str = p+1;
-		min = strtoul(str, &p, 16);
+		min = strtoul(str, &p, 10);
 		if (*p != 0)
 			return -1;
 		if (min >= (1<<16))


             reply	other threads:[~2008-02-13  2:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12 19:37 PJ Waskiewicz [this message]
2008-02-13  3:03 ` [PATCH] [TC U32] Fix input parsing to support more than 9 flow id'scorrectly Waskiewicz Jr, Peter P
2008-02-13  3:26   ` Stephen Hemminger
2008-02-13  4:25     ` Waskiewicz Jr, Peter P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080212193725.4137.62287.stgit@localhost.localdomain \
    --to=peter.p.waskiewicz.jr@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen.hemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox