diff mbox series

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

Message ID 1505164269-9455-8-git-send-email-gvrose8192@gmail.com
State Accepted
Headers show
Series [ovs-dev,V2,01/16] acinclude: Check for SKB_GSO_UDP | expand

Commit Message

Gregory Rose Sept. 11, 2017, 9:11 p.m. UTC
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(-)
diff mbox series

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;