* [PATCH net] vxlan: use nla_put_flag for ttl inherit
@ 2018-09-28 1:08 Hangbin Liu
2018-09-28 10:37 ` Phil Sutter
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Hangbin Liu @ 2018-09-28 1:08 UTC (permalink / raw)
To: netdev
Cc: David Miller, Stephen Hemminger, David Ahern, Phil Sutter, Hangbin Liu
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")
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:
--
2.5.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit
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:57 ` David Ahern
2018-10-04 16:19 ` Stephen Hemminger
2 siblings, 1 reply; 7+ messages in thread
From: Phil Sutter @ 2018-09-28 10:37 UTC (permalink / raw)
To: Hangbin Liu; +Cc: netdev, David Miller, Stephen Hemminger, David Ahern
On Fri, Sep 28, 2018 at 09:08:26AM +0800, 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.
s/opiton/option/
Apart from that, LGTM!
Thanks, Phil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit
2018-09-28 10:37 ` Phil Sutter
@ 2018-09-28 12:38 ` Hangbin Liu
2018-09-28 17:56 ` David Ahern
0 siblings, 1 reply; 7+ messages in thread
From: Hangbin Liu @ 2018-09-28 12:38 UTC (permalink / raw)
To: David Miller; +Cc: Phil Sutter, netdev, Stephen Hemminger, David Ahern
On Fri, Sep 28, 2018 at 12:37:00PM +0200, Phil Sutter wrote:
> On Fri, Sep 28, 2018 at 09:08:26AM +0800, 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.
>
> s/opiton/option/
>
> Apart from that, LGTM!
>
> Thanks, Phil
Opps, sorry...
Hi David,
Should I re-send a patch or will you help fix it directly?
Thanks
Hangbin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit
2018-09-28 12:38 ` Hangbin Liu
@ 2018-09-28 17:56 ` David Ahern
2018-09-29 9:01 ` Hangbin Liu
0 siblings, 1 reply; 7+ messages in thread
From: David Ahern @ 2018-09-28 17:56 UTC (permalink / raw)
To: Hangbin Liu, David Miller; +Cc: Phil Sutter, netdev, Stephen Hemminger
On 9/28/18 6:38 AM, Hangbin Liu wrote:
> On Fri, Sep 28, 2018 at 12:37:00PM +0200, Phil Sutter wrote:
>> On Fri, Sep 28, 2018 at 09:08:26AM +0800, 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.
>>
>> s/opiton/option/
>>
>> Apart from that, LGTM!
>>
>> Thanks, Phil
>
> Opps, sorry...
>
> Hi David,
>
> Should I re-send a patch or will you help fix it directly?
>
> Thanks
> Hangbin
>
you have this targeted at net; is it a bug in current iproute2 or an
update to a new feature in -next?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit
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 17:57 ` David Ahern
2018-10-04 16:19 ` Stephen Hemminger
2 siblings, 0 replies; 7+ messages in thread
From: David Ahern @ 2018-09-28 17:57 UTC (permalink / raw)
To: Hangbin Liu, netdev; +Cc: David Miller, Stephen Hemminger, Phil Sutter
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:
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit
2018-09-28 17:56 ` David Ahern
@ 2018-09-29 9:01 ` Hangbin Liu
0 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2018-09-29 9:01 UTC (permalink / raw)
To: David Ahern; +Cc: David Miller, Phil Sutter, netdev, Stephen Hemminger
On Fri, Sep 28, 2018 at 11:56:10AM -0600, David Ahern wrote:
> On 9/28/18 6:38 AM, Hangbin Liu wrote:
> > On Fri, Sep 28, 2018 at 12:37:00PM +0200, Phil Sutter wrote:
> >> On Fri, Sep 28, 2018 at 09:08:26AM +0800, 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.
> >>
> >> s/opiton/option/
> >>
> >> Apart from that, LGTM!
> >>
> >> Thanks, Phil
> >
> > Opps, sorry...
> >
> > Hi David,
> >
> > Should I re-send a patch or will you help fix it directly?
> >
> > Thanks
> > Hangbin
> >
>
> you have this targeted at net; is it a bug in current iproute2 or an
> update to a new feature in -next?
Hi David Ahern,
This patch targets to kernel net tree. The previous question is for
"David Miller". Sorry for the confusing. Anyway, I will send a v2 patch
for this one as I need to change the commit message.
Thanks
Hangbin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net] vxlan: use nla_put_flag for ttl inherit
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 17:57 ` David Ahern
@ 2018-10-04 16:19 ` Stephen Hemminger
2 siblings, 0 replies; 7+ messages in thread
From: Stephen Hemminger @ 2018-10-04 16:19 UTC (permalink / raw)
To: Hangbin Liu; +Cc: netdev, David Miller, David Ahern, Phil Sutter
On Fri, 28 Sep 2018 09:08:26 +0800
Hangbin Liu <liuhangbin@gmail.com> 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")
> Reported-by: Phil Sutter <phil@nwl.cc>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Applied to iproute2 current release.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-10-04 23:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2018-10-04 16:19 ` 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.