All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
Cc: satoru.satoh@gmail.com, netdev@vger.kernel.org, yoshfuji@linux-ipv6.org
Subject: Re: [PATCH] [IPROUTE]: A workaround to make larger rto_min printed correctly
Date: Fri, 21 Dec 2007 09:14:33 -0800	[thread overview]
Message-ID: <20071221091433.424c52db@deepthought> (raw)
In-Reply-To: <20071221.225804.129665785.yoshfuji@linux-ipv6.org>

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

> In article <d72b7ace0712210549u51043bf8k585fd70e1ded7d8a@mail.gmail.com> (at Fri, 21 Dec 2007 22:49:59 +0900), "Satoru SATOH" <satoru.satoh@gmail.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@linux-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@vyatta.com>

      reply	other threads:[~2007-12-21 17:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-20  3:31 [PATCH] [IPROUTE]: A workaround to make larger rto_min printed correctly Satoru SATOH
2007-12-20  8:35 ` YOSHIFUJI Hideaki / 吉藤英明
2007-12-20  9:12 ` Jarek Poplawski
2007-12-20 16:21   ` Satoru SATOH
2007-12-20 20:24     ` Jarek Poplawski
2007-12-20 20:31       ` Jarek Poplawski
2007-12-21  2:24         ` Satoru SATOH
2007-12-21  8:34           ` Jarek Poplawski
2007-12-21  8:53           ` YOSHIFUJI Hideaki / 吉藤英明
2007-12-21 11:18             ` Bill Fink
2007-12-21 13:49             ` Satoru SATOH
2007-12-21 13:58               ` YOSHIFUJI Hideaki / 吉藤英明
2007-12-21 17:14                 ` Stephen Hemminger [this message]

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=20071221091433.424c52db@deepthought \
    --to=shemminger@linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=satoru.satoh@gmail.com \
    --cc=yoshfuji@linux-ipv6.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.