From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2] gre: Fix ttl inherit option Date: Tue, 28 Nov 2017 09:49:16 -0800 Message-ID: <20171128094916.4453ea1a@xeon-e3> References: <1511867781-11592-1-git-send-email-robertshearman@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, Robert Shearman To: robertshearman@gmail.com Return-path: Received: from mail-pl0-f68.google.com ([209.85.160.68]:34171 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753472AbdK1RtZ (ORCPT ); Tue, 28 Nov 2017 12:49:25 -0500 Received: by mail-pl0-f68.google.com with SMTP id d21so366128pll.1 for ; Tue, 28 Nov 2017 09:49:24 -0800 (PST) In-Reply-To: <1511867781-11592-1-git-send-email-robertshearman@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 28 Nov 2017 11:16:21 +0000 robertshearman@gmail.com wrote: > From: Robert Shearman > > 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 > --- > 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.