You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.6 KiB

  1. commit 2ea824143172e38b4387ef23b8685cebaee21c69
  2. Author: Pravin B Shelar <pshelar@nicira.com>
  3. Date: Tue Sep 24 18:42:43 2013 -0700
  4. datapath: Backport __ip_select_ident() function
  5. definition of __ip_select_ident() changed in newer kernel and
  6. it is backported to stable kernel, Therefore adding configure
  7. check to detect the new function.
  8. Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
  9. Acked-by: Andy Zhou <azhou@nicira.com>
  10. diff --git a/acinclude.m4 b/acinclude.m4
  11. index 7e036e5..b0794d2 100644
  12. --- a/acinclude.m4
  13. +++ b/acinclude.m4
  14. @@ -284,6 +284,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
  15. OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto])
  16. OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast])
  17. + OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry],
  18. + [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])])
  19. OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro])
  20. OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats])
  21. diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c
  22. index d650be2..a70aefc 100644
  23. --- a/datapath/linux/compat/ip_tunnels_core.c
  24. +++ b/datapath/linux/compat/ip_tunnels_core.c
  25. @@ -70,7 +70,12 @@ int iptunnel_xmit(struct rtable *rt,
  26. iph->daddr = dst;
  27. iph->saddr = src;
  28. iph->ttl = ttl;
  29. +
  30. +#ifdef HAVE_IP_SELECT_IDENT_USING_DST_ENTRY
  31. __ip_select_ident(iph, &rt_dst(rt), (skb_shinfo(skb)->gso_segs ?: 1) - 1);
  32. +#else
  33. + __ip_select_ident(iph, skb_shinfo(skb)->gso_segs ?: 1);
  34. +#endif
  35. err = ip_local_out(skb);
  36. if (unlikely(net_xmit_eval(err)))