From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hangbin Liu Subject: Re: [PATCH iproute2] vxlan: show correct ttl inherit info Date: Thu, 27 Sep 2018 22:07:51 +0800 Message-ID: <20180927140750.GD24677@leo.usersys.redhat.com> References: <1538033316-32312-1-git-send-email-liuhangbin@gmail.com> <20180927092745.GV14666@orbyte.nwl.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Phil Sutter , netdev@vger.kernel.org, Stephen Hemminger , David Ahern Return-path: Received: from mail-pg1-f194.google.com ([209.85.215.194]:45854 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727599AbeI0U02 (ORCPT ); Thu, 27 Sep 2018 16:26:28 -0400 Received: by mail-pg1-f194.google.com with SMTP id t70-v6so2034296pgd.12 for ; Thu, 27 Sep 2018 07:08:02 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180927092745.GV14666@orbyte.nwl.cc> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Sep 27, 2018 at 11:27:45AM +0200, Phil Sutter wrote: > Hi Hangbin, > > On Thu, Sep 27, 2018 at 03:28:36PM +0800, Hangbin Liu wrote: > > We should only show ttl inherit when IFLA_VXLAN_TTL_INHERIT supplied. > > Otherwise show the ttl number, or auto when it is 0. > > > > Signed-off-by: Hangbin Liu > > --- > > ip/iplink_vxlan.c | 16 ++++++++++------ > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c > > index 831f39a..7fc0e2b 100644 > > --- a/ip/iplink_vxlan.c > > +++ b/ip/iplink_vxlan.c > > @@ -145,7 +145,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv, > > NEXT_ARG(); > > check_duparg(&attrs, IFLA_VXLAN_TTL, "ttl", *argv); > > if (strcmp(*argv, "inherit") == 0) { > > - addattr_l(n, 1024, IFLA_VXLAN_TTL_INHERIT, NULL, 0); > > + addattr(n, 1024, IFLA_VXLAN_TTL_INHERIT); > > So for VXLAN, the attribute is just added but with a zero value. Looking > at respective kernel code, this seems fine. Now I wonder why for Geneve, > you set the value to 1 and when displaying explicitly check whether the > attribute is there *and* non-zero. OK, looks like Geneve driver always > exports IFLA_GENEVE_TTL_INHERIT. Oddly, I can't find where VXLAN driver > in kernel does export the IFLA_VXLAN_TTL_INHERIT attribute. Am I missing > something? Hi Phil, The vxlan ttl inherit exportation is just fixed by net commit 8fd78069874 ("vxlan: fill ttl inherit info") yesterday. > Do you know why handling of the attributes in both drivers differ? That's because I set IFLA_VXLAN_TTL_INHERIT type to NLA_FLAG. But when fix the geneve issue, I forgot this and set IFLA_GENEVE_TTL_INHERIT type to NLA_U8... :( I noticed this when post the iproute2 patch. But I thought this should have no much influence, so I just leave it as it is. If you think we'd better have a same behaver. We can drop the geneve iproute2 patch and post a fix to net kernel tree. Thanks Hangbin