[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAABrY5oR+UvxWwrYFajEzUT8ccGDHAYW0bBUOfNcUn6SYA+fjw@mail.gmail.com>
Date: Fri, 14 Jun 2013 08:45:04 +0200
From: Philipp Schönberger
<ph.schoenberger@...glemail.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
netdev@...r.kernel.org
Subject: Re: [iproute2 PATCH] tc: handle is not used without containing ':'
Did not notice it was not formatted correct sorry :-)
Signed-off-by: Philipp Schönberger <ph.schoenberger@...glemail.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;
2013/6/13 Sergei Shtylyov <sergei.shtylyov@...entembedded.com>:
> Hello.
>
>
> On 06/13/2013 09:20 PM, Philipp Schönberger 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@...glemail.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)
>
>
> Maybe you should be more consistent in using space after *if*? :-)
>
>
>> + return -1;
>> + else if (TC_H_MIN(maj) != 0)
>> + return -1;
>> + }else
>
>
> Space after } seems a good idea too...
>
>
>> + maj <<= 16;
>> ok:
>> *h = maj;
>> return 0;
>
>
> WBR, Sergei
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists