diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-11-21 12:59:41 +0000 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-12-22 09:40:23 +0000 |
commit | e34cb44ac7c08783b98a16eec70125e205e6eb12 (patch) | |
tree | 1101d23f1a73e5627ae187b07c7a0cf8826e10d1 /backport-include/net/ip6_fib.h |
initial commit
Generated againts 4.14 kernel source with
git backports 1d8cc151d365582b42be00af776270b834a7a37d
Diffstat (limited to 'backport-include/net/ip6_fib.h')
-rw-r--r-- | backport-include/net/ip6_fib.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/backport-include/net/ip6_fib.h b/backport-include/net/ip6_fib.h new file mode 100644 index 0000000..2f21163 --- /dev/null +++ b/backport-include/net/ip6_fib.h @@ -0,0 +1,26 @@ +#ifndef __BACKPORT_NET_IP6_ROUTE_H +#define __BACKPORT_NET_IP6_ROUTE_H +#include_next <net/ip6_fib.h> +#include <net/ip6_route.h> +#include <linux/route.h> +#include <linux/version.h> + +/* + * This function is avaliable with one argument since kernel 3.10, but the + * secound one was added in 4.2. + */ +#if LINUX_VERSION_IS_LESS(4,2,0) +#define rt6_nexthop LINUX_BACKPORT(rt6_nexthop) +static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, + struct in6_addr *daddr) +{ + if (rt->rt6i_flags & RTF_GATEWAY) + return &rt->rt6i_gateway; + else if (rt->rt6i_flags & RTF_CACHE) + return &rt->rt6i_dst.addr; + else + return daddr; +} +#endif /* LINUX_VERSION_IS_LESS(4,2,0) */ + +#endif /* __BACKPORT_NET_IP6_ROUTE_H */ |