* 02110-1301, USA
*/
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#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"
+#ifndef GRE_USE_KERNEL_GRE_HANDLE_OFFLOADS
int iptunnel_xmit(struct rtable *rt,
struct sk_buff *skb,
__be32 src, __be32 dst, __u8 proto,
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)))
return 0;
}
-#endif /* 3.12 */
+#endif