lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FFE2580.7020404@cn.fujitsu.com>
Date:	Thu, 12 Jul 2012 09:16:48 +0800
From:	Li Wei <lw@...fujitsu.com>
To:	Stephen Hemminger <shemminger@...tta.com>
CC:	netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] tc_util: fix incorrect bare number process in get_rate.

于 2012-7-11 22:51, Stephen Hemminger 写道:
> On Wed, 11 Jul 2012 15:24:50 +0800
> Li Wei <lw@...fujitsu.com> wrote:
> 
>>
>> As the comment and manpage indicated that the bare number means
>> bytes per second, so the division is not needed.
>> ---
>>  tc/tc_util.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/tc/tc_util.c b/tc/tc_util.c
>> index 926ed08..e8d89c1 100644
>> --- a/tc/tc_util.c
>> +++ b/tc/tc_util.c
>> @@ -153,7 +153,7 @@ int get_rate(unsigned *rate, const char *str)
>>  		return -1;
>>  
>>  	if (*p == '\0') {
>> -		*rate = bps / 8.;	/* assume bytes/sec */
>> +		*rate = bps;	/* assume bytes/sec */
>>  		return 0;
>>  	}
>>  
> Thanks for finding this. The documentation, code and comment do
> all need to be the same!
> 
> But changing the code as you propose would break existing usage
> by scripts. Instead, the man page and comment need to change
> to match the reality of the existing application.
> 
> 
Well, I see, I'll send another patch to take care of this.

Thanks,

Wei

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ