File datapath-vxlan_xmit.patch of Package openvswitch.2686

Index: datapath/linux/compat/include/net/vxlan.h
===================================================================
--- datapath/linux/compat/include/net/vxlan.h.orig
+++ datapath/linux/compat/include/net/vxlan.h
@@ -5,12 +5,30 @@
 #include <linux/netdevice.h>
 #include <linux/udp.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) || \
-   defined(HAVE_VXLAN_SOCK_ADD)
+#include <linux/version.h>
+#ifdef USE_KERNEL_TUNNEL_API
 #include_next <net/vxlan.h>
-#endif
 
-#ifndef HAVE_VXLAN_SOCK_ADD
+static inline int rpl_vxlan_xmit_skb(struct vxlan_sock *vs,
+                                     struct rtable *rt, struct sk_buff *skb,
+                                     __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
+                                     __be16 src_port, __be16 dst_port, __be32 vni)
+{
+    if (skb->encapsulation && skb_is_gso(skb)) {
+        kfree_skb(skb);
+        return -ENOSYS;
+    }
+    #ifndef HAVE_IPTUNNEL_XMIT_NET
+    return vxlan_xmit_skb(vs, rt, skb, src, dst, tos, ttl, df,
+                          src_port, dst_port, vni);
+    #else
+    return vxlan_xmit_skb(NULL, vs, rt, skb, src, dst, tos, ttl, df,
+                          src_port, dst_port, vni);
+    #endif
+}
+#define vxlan_xmit_skb rpl_vxlan_xmit_skb
+
+#else
 
 struct vxlan_sock;
 typedef void (vxlan_rcv_t)(struct vxlan_sock *vs, struct sk_buff *skb, __be32 key);
@@ -38,5 +56,5 @@ int vxlan_xmit_skb(struct vxlan_sock *vs
 
 __be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb);
 
-#endif /* HAVE_VXLAN_SOCK_ADD */
+#endif /* USE_KERNEL_TUNNEL_API */
 #endif
openSUSE Build Service is sponsored by