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] [day] [month] [year] [list]
Date:	Fri, 21 Dec 2007 09:14:33 -0800
From:	Stephen Hemminger <shemminger@...ux-foundation.org>
To:	YOSHIFUJI Hideaki / 吉藤英明 
	<yoshfuji@...ux-ipv6.org>
Cc:	satoru.satoh@...il.com, netdev@...r.kernel.org,
	yoshfuji@...ux-ipv6.org
Subject: Re: [PATCH] [IPROUTE]: A workaround to make larger rto_min printed
 correctly

On Fri, 21 Dec 2007 22:58:04 +0900 (JST)
YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@...ux-ipv6.org> wrote:

> In article <d72b7ace0712210549u51043bf8k585fd70e1ded7d8a@...l.gmail.com> (at Fri, 21 Dec 2007 22:49:59 +0900), "Satoru SATOH" <satoru.satoh@...il.com> says:
> 
> > I agree.
> > 
> > I mistakenly thought hz in that context must be larger than 1000..
> > As it's uncertain, your's looks much simpler and better.
> > 
> > (btw, the lines "else .... div = 1" is not needed, is it?)
> 
> Simplest fix is as follows:
> 
> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
> --
> diff --git a/ip/iproute.c b/ip/iproute.c
> index f4200ae..7a885b0 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -509,7 +509,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
>  			    i != RTAX_RTO_MIN)
>  				fprintf(fp, " %u", *(unsigned*)RTA_DATA(mxrta[i]));
>  			else {
> -				unsigned val = *(unsigned*)RTA_DATA(mxrta[i]);
> +				unsigned long long val = *(unsigned*)RTA_DATA(mxrta[i]);
>  
>  				val *= 1000;
>  				if (i == RTAX_RTT)
> @@ -517,7 +517,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
>  				else if (i == RTAX_RTTVAR)
>  					val /= 4;
>  				if (val >= hz)
> -					fprintf(fp, " %ums", val/hz);
> +					fprintf(fp, " %llums", val/hz);
>  				else
>  					fprintf(fp, " %.2fms", (float)val/hz);
>  			}
> 

applied thanks.

-- 
Stephen Hemminger <stephen.hemminger@...tta.com>
--
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