From: David Miller <davem@davemloft.net>
To: shemminger@vyatta.com
Cc: jengelh@medozas.de, stephen.hemminger@vyatta.com, netdev@vger.kernel.org
Subject: Re: iproute2: prints bogus hoplimit
Date: Wed, 18 Mar 2009 17:51:09 -0700 (PDT) [thread overview]
Message-ID: <20090318.175109.14058201.davem@davemloft.net> (raw)
In-Reply-To: <20090318151216.60cd0363@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 18 Mar 2009 15:12:16 -0700
> On Tue, 24 Feb 2009 11:27:52 +0100 (CET)
> Jan Engelhardt <jengelh@medozas.de> wrote:
>
> >
> > $ ip -6 r
> > fc00::/7 dev rtl0 proto kernel metric 256 mtu 1500 advmss 1440
> > hoplimit 4294967295
> >
> > Most likely, "hoplimit -1" would be the right number, though I am not
> > sure if simply changing %u by %d is a correct thing to do, since it
> > would affect all fields.
...
> > diff --git a/ip/iproute.c b/ip/iproute.c
> > index 6a2ea05..91a8cc0 100644
> > --- a/ip/iproute.c
> > +++ b/ip/iproute.c
> > @@ -507,7 +507,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
> >
> > if (i != RTAX_RTT && i != RTAX_RTTVAR &&
> > i != RTAX_RTO_MIN)
> > - fprintf(fp, " %u", *(unsigned*)RTA_DATA(mxrta[i]));
> > + fprintf(fp, " %d", *(unsigned*)RTA_DATA(mxrta[i]));
> > else {
> > unsigned long long val = *(unsigned*)RTA_DATA(mxrta[i]);
> >
>
> No fix the kernel please.
I don't know what you mean by this Stephen. Why don't you take
a look at when and why the kernel uses '-1'?
"-1" is the hoplimit the kernel uses in the dst metric to mean
"use the default".
So this iproute patch is absolutely correct, or alternatively, iproute
can print "default" when it sees '-1'.
next prev parent reply other threads:[~2009-03-19 0:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-24 10:27 iproute2: prints bogus hoplimit Jan Engelhardt
2009-03-18 22:12 ` Stephen Hemminger
2009-03-18 22:35 ` Jan Engelhardt
2009-03-18 23:29 ` Stephen Hemminger
2009-03-19 0:54 ` David Miller
2009-03-19 0:51 ` David Miller [this message]
2009-03-19 1:01 ` Stephen Hemminger
2009-03-19 1:06 ` David Miller
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=20090318.175109.14058201.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jengelh@medozas.de \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=stephen.hemminger@vyatta.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).