datapath: compat: Fix compilation 3.11
[cascardo/ovs.git] / datapath / linux / compat / ip_tunnels_core.c
index f9f6cae..0e122c6 100644 (file)
@@ -16,6 +16,7 @@
  * 02110-1301, USA
  */
 
+
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/in.h>
@@ -27,6 +28,7 @@
 #include <linux/version.h>
 #include <linux/workqueue.h>
 #include <linux/rculist.h>
+#include <net/gre.h>
 #include <net/ip_tunnels.h>
 #include <net/route.h>
 #include <net/xfrm.h>
 #include "compat.h"
 #include "gso.h"
 
-int iptunnel_xmit(struct net *net, struct rtable *rt,
+#ifndef USE_KERNEL_TUNNEL_API
+int iptunnel_xmit(struct rtable *rt,
                  struct sk_buff *skb,
                  __be32 src, __be32 dst, __u8 proto,
-                 __u8 tos, __u8 ttl, __be16 df)
+                 __u8 tos, __u8 ttl, __be16 df, bool xnet)
 {
        int pkt_len = skb->len;
        struct iphdr *iph;
@@ -45,7 +48,7 @@ int iptunnel_xmit(struct net *net, struct rtable *rt,
 
        nf_reset(skb);
        secpath_reset(skb);
-       skb_clear_rxhash(skb);
+       skb_clear_hash(skb);
        skb_dst_drop(skb);
        skb_dst_set(skb, &rt_dst(rt));
 #if 0
@@ -67,7 +70,12 @@ int iptunnel_xmit(struct net *net, struct rtable *rt,
        iph->daddr      =       dst;
        iph->saddr      =       src;
        iph->ttl        =       ttl;
+
+#ifdef HAVE_IP_SELECT_IDENT_USING_DST_ENTRY
        __ip_select_ident(iph, &rt_dst(rt), (skb_shinfo(skb)->gso_segs ?: 1) - 1);
+#else
+       __ip_select_ident(iph, skb_shinfo(skb)->gso_segs ?: 1);
+#endif
 
        err = ip_local_out(skb);
        if (unlikely(net_xmit_eval(err)))
@@ -101,10 +109,12 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto)
 
        nf_reset(skb);
        secpath_reset(skb);
-       skb_clear_rxhash(skb);
+       skb_clear_hash(skb);
        skb_dst_drop(skb);
        vlan_set_tci(skb, 0);
        skb_set_queue_mapping(skb, 0);
        skb->pkt_type = PACKET_HOST;
        return 0;
 }
+
+#endif