netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2] ip route: should show the hoplimit value what kernel returns
Date: Thu, 14 May 2015 15:40:10 -0700	[thread overview]
Message-ID: <20150514154010.0a3ea6ee@urahara> (raw)
In-Reply-To: <1431480899-9818-1-git-send-email-liuhangbin@gmail.com>

On Wed, 13 May 2015 09:34:59 +0800
Hangbin Liu <liuhangbin@gmail.com> wrote:

> 1. Kernel commit a02e4b7 set the default hoplimit as zero.
> 2. Kernel should return the correct values and iproute should show what kernel
> returns, not invent magic transformations.
> 
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
>  ip/iproute.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/ip/iproute.c b/ip/iproute.c
> index 670a4c6..569bff9 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -579,9 +579,6 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
>  				print_rtax_features(fp, val);
>  				break;
>  			case RTAX_HOPLIMIT:
> -				if ((int)val == -1)
> -					val = 0;
> -				/* fall through */
>  			default:
>  				fprintf(fp, " %u", val);
>  				break;

This is going to cause a mess with older kernels. Since val will be -1
people will see that printed as unsigned and freak.

  reply	other threads:[~2015-05-14 22:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  1:34 [PATCH iproute2] ip route: should show the hoplimit value what kernel returns Hangbin Liu
2015-05-14 22:40 ` Stephen Hemminger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-05-12  5:32 Hangbin Liu

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=20150514154010.0a3ea6ee@urahara \
    --to=stephen@networkplumber.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.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 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).