From: Stephen Hemminger <stephen@networkplumber.org>
To: "Philipp Schönberger" <ph.schoenberger@googlemail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [iproute2 PATCH] tc: handle is not used without containing ':'
Date: Tue, 18 Jun 2013 10:48:05 -0700 [thread overview]
Message-ID: <20130618104805.112f186e@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <CAABrY5pGnVQPctPUSJAiM0tp3o2OTxjG5y8yt3bY59r=x2Gksg@mail.gmail.com>
On Thu, 13 Jun 2013 19:20:52 +0200
Philipp Schönberger <ph.schoenberger@googlemail.com> wrote:
> Handle is not used if it is not containing a ':' . This is
> reproducible with these commands.
>
> /sbin/tc qdisc add dev lo parent 0xffffffff handle 0x10000 pfifo limit 10
>
> /sbin/tc qdisc show dev lo
> qdisc pfifo 8001: root refcnt 2 limit 10p
>
> Signed-off-by: Philipp Schönberger <ph.schoenberger@googlemail.com>
> --- iproute2-2.6.33/tc/tc_util.c 2010-02-25 04:56:50.000000000 +0100
> +++ /home/pschoen/tc_util.c 2013-06-13 18:31:00.347135625 +0200
> @@ -50,9 +50,14 @@
> maj = strtoul(str, &p, 16);
> if (p == str)
> return -1;
> - maj <<= 16;
> - if (*p != ':' && *p!=0)
> - return -1;
> + if (*p != ':')
> + {
> + if(*p!=0)
> + return -1;
> + else if (TC_H_MIN(maj) != 0)
> + return -1;
> + }else
> + maj <<= 16;
> ok:
> *h = maj;
> return 0;
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
The syntax for tc has always reqired : after the handle.
http://www.lartc.org/howto/lartc.qdisc.classful.html
One could argue the error checking could be better, but not worth changing
the syntax now.
next prev parent reply other threads:[~2013-06-18 17:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 17:20 [iproute2 PATCH] tc: handle is not used without containing ':' Philipp Schönberger
2013-06-13 17:39 ` Sergei Shtylyov
2013-06-14 6:45 ` Philipp Schönberger
2013-06-18 17:48 ` Stephen Hemminger [this message]
2013-06-18 18:27 ` Philipp Schönberger
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=20130618104805.112f186e@nehalam.linuxnetplumber.net \
--to=stephen@networkplumber.org \
--cc=netdev@vger.kernel.org \
--cc=ph.schoenberger@googlemail.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;
as well as URLs for NNTP newsgroup(s).