From: David Ahern <dsahern@gmail.com>
To: Hangbin Liu <liuhangbin@gmail.com>, netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
Stephen Hemminger <stephen@networkplumber.org>,
Phil Sutter <phil@nwl.cc>
Subject: Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit
Date: Fri, 28 Sep 2018 11:57:33 -0600 [thread overview]
Message-ID: <62ec4d0d-01a5-50a9-ff96-66eebfe917d5@gmail.com> (raw)
In-Reply-To: <1538096906-20866-1-git-send-email-liuhangbin@gmail.com>
On 9/27/18 7:08 PM, Hangbin Liu wrote:
> Phil pointed out that there is a mismatch between vxlan and geneve ttl inherit.
> We should define it as a flag and use nla_put_flag to export this opiton.
>
> Fixes: 8fd780698745b ("vxlan: fill ttl inherit info")
Wrong Fixes tag:
kenny:mgmt:iproute2-next.git$ git show 8fd780698745b
fatal: ambiguous argument '8fd780698745b': unknown revision or path not
in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
> Reported-by: Phil Sutter <phil@nwl.cc>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
> ---
> drivers/net/vxlan.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 2b8da2b..479dda4 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -3539,7 +3539,7 @@ static size_t vxlan_get_size(const struct net_device *dev)
> nla_total_size(sizeof(__u32)) + /* IFLA_VXLAN_LINK */
> nla_total_size(sizeof(struct in6_addr)) + /* IFLA_VXLAN_LOCAL{6} */
> nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_TTL */
> - nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_TTL_INHERIT */
> + nla_total_size(0) + /* IFLA_VXLAN_TTL_INHERIT */
> nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_TOS */
> nla_total_size(sizeof(__be32)) + /* IFLA_VXLAN_LABEL */
> nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_LEARNING */
> @@ -3604,8 +3604,6 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
> }
>
> if (nla_put_u8(skb, IFLA_VXLAN_TTL, vxlan->cfg.ttl) ||
> - nla_put_u8(skb, IFLA_VXLAN_TTL_INHERIT,
> - !!(vxlan->cfg.flags & VXLAN_F_TTL_INHERIT)) ||
> nla_put_u8(skb, IFLA_VXLAN_TOS, vxlan->cfg.tos) ||
> nla_put_be32(skb, IFLA_VXLAN_LABEL, vxlan->cfg.label) ||
> nla_put_u8(skb, IFLA_VXLAN_LEARNING,
> @@ -3650,6 +3648,10 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
> nla_put_flag(skb, IFLA_VXLAN_REMCSUM_NOPARTIAL))
> goto nla_put_failure;
>
> + if (vxlan->cfg.flags & VXLAN_F_TTL_INHERIT &&
> + nla_put_flag(skb, IFLA_VXLAN_TTL_INHERIT))
> + goto nla_put_failure;
> +
> return 0;
>
> nla_put_failure:
>
next prev parent reply other threads:[~2018-09-29 0:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 1:08 [PATCH net] vxlan: use nla_put_flag for ttl inherit Hangbin Liu
2018-09-28 10:37 ` Phil Sutter
2018-09-28 12:38 ` Hangbin Liu
2018-09-28 17:56 ` David Ahern
2018-09-29 9:01 ` Hangbin Liu
2018-09-28 17:57 ` David Ahern [this message]
2018-10-04 16:19 ` Stephen Hemminger
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=62ec4d0d-01a5-50a9-ff96-66eebfe917d5@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=liuhangbin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=phil@nwl.cc \
--cc=stephen@networkplumber.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).