* [PATCH iproute2] gre: Fix ttl inherit option
@ 2017-11-28 11:16 robertshearman
2017-11-28 17:49 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: robertshearman @ 2017-11-28 11:16 UTC (permalink / raw)
To: stephen, netdev; +Cc: Robert Shearman
From: Robert Shearman <rs823p@att.com>
Specifying "... ttl inherit" currently does nothing on a GRE link
modify since the previous ttl value is retrieved up front. Fix this by
explicitly setting ttl to 0 when "inherit" is specified for the
option, since 0 represents the semantics of inherit.
Signed-off-by: Robert Shearman <rs823p@att.com>
---
ip/link_gre.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ip/link_gre.c b/ip/link_gre.c
index 35782caaa68b..43cb1af6196a 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -276,7 +276,8 @@ get_failed:
if (uval > 255)
invarg("TTL must be <= 255\n", *argv);
ttl = uval;
- }
+ } else
+ ttl = 0;
} else if (!matches(*argv, "tos") ||
!matches(*argv, "tclass") ||
!matches(*argv, "dsfield")) {
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH iproute2] gre: Fix ttl inherit option
2017-11-28 11:16 [PATCH iproute2] gre: Fix ttl inherit option robertshearman
@ 2017-11-28 17:49 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2017-11-28 17:49 UTC (permalink / raw)
To: robertshearman; +Cc: netdev, Robert Shearman
On Tue, 28 Nov 2017 11:16:21 +0000
robertshearman@gmail.com wrote:
> From: Robert Shearman <rs823p@att.com>
>
> Specifying "... ttl inherit" currently does nothing on a GRE link
> modify since the previous ttl value is retrieved up front. Fix this by
> explicitly setting ttl to 0 when "inherit" is specified for the
> option, since 0 represents the semantics of inherit.
>
> Signed-off-by: Robert Shearman <rs823p@att.com>
> ---
> ip/link_gre.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ip/link_gre.c b/ip/link_gre.c
> index 35782caaa68b..43cb1af6196a 100644
> --- a/ip/link_gre.c
> +++ b/ip/link_gre.c
> @@ -276,7 +276,8 @@ get_failed:
> if (uval > 255)
> invarg("TTL must be <= 255\n", *argv);
> ttl = uval;
> - }
> + } else
> + ttl = 0;
> } else if (!matches(*argv, "tos") ||
> !matches(*argv, "tclass") ||
> !matches(*argv, "dsfield")) {
Applied. Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-28 17:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 11:16 [PATCH iproute2] gre: Fix ttl inherit option robertshearman
2017-11-28 17:49 ` Stephen Hemminger
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.