All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] ip route: should show the hoplimit value what kernel returns
@ 2015-05-13  1:34 Hangbin Liu
  2015-05-14 22:40 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2015-05-13  1:34 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Hangbin Liu

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2] ip route: should show the hoplimit value what kernel returns
  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
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2015-05-14 22:40 UTC (permalink / raw)
  To: Hangbin Liu; +Cc: netdev

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH iproute2] ip route: should show the hoplimit value what kernel returns
@ 2015-05-12  5:32 Hangbin Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Hangbin Liu @ 2015-05-12  5:32 UTC (permalink / raw)
  To: netdev; +Cc: Ulrich Weber, Stephen Hemminger, Hangbin Liu

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-14 22:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2015-05-12  5:32 Hangbin Liu

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.