File datapath-Backport-__ip_select_ident-function.patch of Package openvswitch.openSUSE_13.1_Update
From: Pravin B Shelar <pshelar@nicira.com>
Date: Tue, 24 Sep 2013 18:42:43 -0700
Subject: datapath: Backport __ip_select_ident() function
Patch-mainline: v2.4.0
Git-commit: 2ea824143172e38b4387ef23b8685cebaee21c69
definition of __ip_select_ident() changed in newer kernel and
it is backported to stable kernel, Therefore adding configure
check to detect the new function.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
Acked-by: Michal Kubecek <mkubecek@suse.cz>
Conflicts:
datapath/linux/compat/ip_tunnels_core.c
---
acinclude.m4 | 2 ++
datapath/tunnel.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/acinclude.m4 b/acinclude.m4
index cc45a3aea672..71344a6e9b4e 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -220,6 +220,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto])
OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast])
+ OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry],
+ [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])])
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro])
OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats])
diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index d9aa51281457..828c79eb21f3 100644
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -301,7 +301,11 @@ int ovs_tnl_send(struct vport *vport, struct sk_buff *skb)
* when the DF bit is set.
*/
skb->local_df = 1;
+#ifdef HAVE_IP_SELECT_IDENT_USING_DST_ENTRY
__ip_select_ident(iph, skb_dst(skb), 0);
+#else
+ __ip_select_ident(iph, 0);
+#endif
memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
--
2.6.3