From: Greg Rose <[email protected]>
Upstream commit:
commit dc5321d79697db1b610c25fa4fad1aec7533ea3e
Author: Matthias Schiffer <[email protected]>
Date: Mon Jun 19 10:03:56 2017 +0200
vxlan: get rid of redundant vxlan_dev.flags
There is no good reason to keep the flags twice in vxlan_dev and
vxlan_config.
Signed-off-by: Matthias Schiffer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Applied using HAVE_VXLAN_DEV_CFG compatibility flag defined in
acinclude.m4.
Signed-off-by: Greg Rose <[email protected]>
Signed-off-by: Joe Stringer <[email protected]>
---
v2: Shift compat symbol definitions to patch which uses it.
---
acinclude.m4 | 2 ++
datapath/vport-vxlan.c | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/acinclude.m4 b/acinclude.m4
index 99326824923c..d72e13cd6c73 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -753,6 +753,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
OVS_FIND_FIELD_IFELSE([$KSRC/include/linux/netdevice.h], [net_device],
[needs_free_netdev],
[OVS_DEFINE([HAVE_NEEDS_FREE_NETDEV])])
+ OVS_FIND_FIELD_IFELSE([$KSRC/include/net/vxlan.h], [vxlan_dev], [cfg],
+ [OVS_DEFINE([HAVE_VXLAN_DEV_CFG])])
OVS_GREP_IFELSE([$KSRC/include/net/netfilter/nf_conntrack_helper.h],
[nf_conntrack_helper_put])
diff --git a/datapath/vport-vxlan.c b/datapath/vport-vxlan.c
index fbde91f50ec5..291069441262 100644
--- a/datapath/vport-vxlan.c
+++ b/datapath/vport-vxlan.c
@@ -40,14 +40,22 @@ static int vxlan_get_options(const struct vport *vport,
struct sk_buff *skb)
if (nla_put_u16(skb, OVS_TUNNEL_ATTR_DST_PORT, ntohs(dst_port)))
return -EMSGSIZE;
+#ifdef HAVE_VXLAN_DEV_CFG
+ if (vxlan->cfg.flags & VXLAN_F_GBP) {
+#else
if (vxlan->flags & VXLAN_F_GBP) {
+#endif
struct nlattr *exts;
exts = nla_nest_start(skb, OVS_TUNNEL_ATTR_EXTENSION);
if (!exts)
return -EMSGSIZE;
+#ifdef HAVE_VXLAN_DEV_CFG
+ if (vxlan->cfg.flags & VXLAN_F_GBP &&
+#else
if (vxlan->flags & VXLAN_F_GBP &&
+#endif
nla_put_flag(skb, OVS_VXLAN_EXT_GBP))
return -EMSGSIZE;
--
2.11.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev