]> git.proxmox.com Git - mirror_ovs.git/blob - datapath/linux/compat/include/net/ip6_fib.h
datapath: Fix builds on older kernels.
[mirror_ovs.git] / datapath / linux / compat / include / net / ip6_fib.h
1 /*
2 * Linux INET6 implementation
3 *
4 * Authors:
5 * Pedro Roque <roque@di.fc.ul.pt>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13 #ifndef _IP6_FIB_WRAPPER_H
14 #define _IP6_FIB_WRAPPER_H
15
16 #include_next <net/ip6_fib.h>
17
18 #ifndef HAVE_RT6_GET_COOKIE
19
20 #ifndef RTF_PCPU
21 #define RTF_PCPU 0x40000000
22 #endif
23
24 #ifndef RTF_LOCAL
25 #define RTF_LOCAL 0x80000000
26 #endif
27
28 #define rt6_get_cookie rpl_rt6_get_cookie
29 static inline u32 rt6_get_cookie(const struct rt6_info *rt)
30 {
31 if (rt->rt6i_flags & RTF_PCPU ||
32 #ifdef HAVE_DST_NOCACHE
33 (unlikely(rt->dst.flags & DST_NOCACHE) && rt->dst.from))
34 #else
35 (unlikely(!list_empty(&rt->rt6i_uncached)) && rt->dst.from))
36 #endif
37 rt = (struct rt6_info *)(rt->dst.from);
38
39 return rt->rt6i_node ? rt->rt6i_node->fn_sernum : 0;
40 }
41 #endif
42
43 #endif