diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 27d83183e615..30cbb15f6279 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -23,6 +23,7 @@ struct route_info { #include #include #include +#include #define RT6_LOOKUP_F_IFACE 0x00000001 #define RT6_LOOKUP_F_REACHABLE 0x00000002 @@ -194,4 +195,11 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); } +static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest) +{ + if (rt->rt6i_flags & RTF_GATEWAY) + return &rt->rt6i_gateway; + return dest; +} + #endif