[ovs-dev,08/15] compat: Add check for DST_NOCACHE

Message ID 1505152570-6143-8-git-send-email-gvrose8192@gmail.com
State New
Headers show
Series
  • [ovs-dev,01/15] acinclude: Check for SKB_GSO_UDP
Related show

Commit Message

Greg Rose Sept. 11, 2017, 5:56 p.m.
DST_NOCACHE was removed from the Linux 4.13 kernel.  Check if
HAVE_DST_NOCACHE is defined for older kernels.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/linux/compat/include/net/ip6_fib.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/datapath/linux/compat/include/net/ip6_fib.h b/datapath/linux/compat/include/net/ip6_fib.h
index 2c8a513..4d58375 100644
--- a/datapath/linux/compat/include/net/ip6_fib.h
+++ b/datapath/linux/compat/include/net/ip6_fib.h
@@ -27,7 +27,11 @@ 
 static inline u32 rt6_get_cookie(const struct rt6_info *rt)
 {
 	if (rt->rt6i_flags & RTF_PCPU ||
-			(unlikely(rt->dst.flags & DST_NOCACHE) && rt->dst.from))
+#ifdef HAVE_DST_NOCACHE
+	    (unlikely(rt->dst.flags & DST_NOCACHE) && rt->dst.from))
+#else
+	    (unlikely(!list_empty(&rt->rt6i_uncached)) && rt->dst.from))
+#endif
 		rt = (struct rt6_info *)(rt->dst.from);
 
 	return rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;