-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
datapath: Fix builds on older kernels.
On older kernels, for example 3.19, the function rt6_get_cookie() is not available and used with ipv6 config enabled; it was introduced in 4.2. Put back the replacement function if it does not exist. Add a 3.19 version to travis. CC: Yifeng Sun <[email protected]> Fixes: bf61b8b ("datapath: Add support for kernel 4.16.x & 4.17.x.") Signed-off-by: Darrell Ball <[email protected]> Signed-off-by: Ben Pfaff <[email protected]> Tested-by: Yifeng Sun <[email protected]> Reviewed-by: Yifeng Sun <[email protected]>
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Linux INET6 implementation | ||
* | ||
* Authors: | ||
* Pedro Roque <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
|
||
#ifndef _IP6_FIB_WRAPPER_H | ||
#define _IP6_FIB_WRAPPER_H | ||
|
||
#include_next <net/ip6_fib.h> | ||
|
||
#ifndef HAVE_RT6_GET_COOKIE | ||
|
||
#ifndef RTF_PCPU | ||
#define RTF_PCPU 0x40000000 | ||
#endif | ||
|
||
#ifndef RTF_LOCAL | ||
#define RTF_LOCAL 0x80000000 | ||
#endif | ||
|
||
#define rt6_get_cookie rpl_rt6_get_cookie | ||
static inline u32 rt6_get_cookie(const struct rt6_info *rt) | ||
{ | ||
if (rt->rt6i_flags & RTF_PCPU || | ||
#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; | ||
} | ||
#endif | ||
|
||
#endif |