#define VXLAN_F_GBP 0x800
#endif
+#ifndef VXLAN_F_RCV_FLAGS
+#define VXLAN_F_RCV_FLAGS VXLAN_F_GBP
+#endif
+
#ifdef HAVE_VXLAN_METADATA
#define USE_UPSTREAM_VXLAN
struct rtable *rt, struct sk_buff *skb,
__be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
__be16 src_port, __be16 dst_port,
- struct vxlan_metadata *md, bool xnet)
+ struct vxlan_metadata *md, bool xnet, u32 vxflags)
{
if (skb_is_gso(skb) && skb_is_encapsulated(skb)) {
kfree_skb(skb);
return -ENOSYS;
}
- return vxlan_xmit_skb(vs, rt, skb, src, dst, tos, ttl, df,
- src_port, dst_port, md, xnet);
+ return vxlan_xmit_skb(rt, skb, src, dst, tos, ttl, df,
+ src_port, dst_port, md, xnet, vxflags);
}
#define vxlan_xmit_skb rpl_vxlan_xmit_skb
struct rtable *rt, struct sk_buff *skb,
__be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
__be16 src_port, __be16 dst_port,
- struct vxlan_metadata *md, bool xnet);
+ struct vxlan_metadata *md, bool xnet, u32 vxflags);
#define vxlan_src_port rpl_vxlan_src_port
__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb);
return ovs_iptunnel_handle_offloads(skb, false, vxlan_gso);
}
-static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, struct vxlan_sock *vs,
+static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, u32 vxflags,
struct vxlan_metadata *md)
{
struct vxlanhdr_gbp *gbp;
struct rtable *rt, struct sk_buff *skb,
__be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
__be16 src_port, __be16 dst_port,
- struct vxlan_metadata *md, bool xnet)
+ struct vxlan_metadata *md, bool xnet, u32 vxflags)
{
struct vxlanhdr *vxh;
struct udphdr *uh;
vxh->vx_flags = htonl(VXLAN_HF_VNI);
vxh->vx_vni = md->vni;
- if (vs->flags & VXLAN_F_GBP)
- vxlan_build_gbp_hdr(vxh, vs, md);
+ if (vxflags & VXLAN_F_GBP)
+ vxlan_build_gbp_hdr(vxh, vxflags, md);
__skb_push(skb, sizeof(*uh));
skb_reset_transport_header(skb);
}
vs->rcv = rcv;
vs->data = data;
- vs->flags = flags;
+ vs->flags = (flags & VXLAN_F_RCV_FLAGS);
/* Disable multicast loopback */
inet_sk(sk)->mc_loop = 0;