Handle ip_select_ident changes, fix for debian bug #768095

Patch picked from ubuntu [1] (only the tunnel.c part), author Chris J Arges
<chris.j.arges@ubuntu.com>.

  [1]: https://launchpadlibrarian.net/187027526/openvswitch_1.4.6-0ubuntu1.12.04.3_1.4.6-0ubuntu1.12.04.4.diff.gz
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -1291,7 +1291,22 @@
 		iph->tos = tos;
 		iph->ttl = ttl;
 		iph->frag_off = frag_off;
+
+		/*
+		 * linux commits 703133de, 73f156a6 changed this function
+		 * affected stable versions are: 3.13.11.7, 3.2.63
+		 */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,11)       /* commit 73f156a6 */
+                ip_select_ident(skb, &rt_dst(rt));
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)	/* commit 703133de */
+		ip_select_ident(skb, &rt_dst(rt), NULL);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,63)	/* commit 73f156a6 */
+		ip_select_ident(skb, &rt_dst(rt));
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,51)	/* commit 703133de */
+		ip_select_ident(skb, &rt_dst(rt), NULL);
+#else
 		ip_select_ident(iph, &rt_dst(rt), NULL);
+#endif
 
 		skb = tnl_vport->tnl_ops->update_header(vport, mutable,
 							&rt_dst(rt), skb);
