summaryrefslogtreecommitdiffstats
path: root/include/net/route.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/route.h')
-rw-r--r--include/net/route.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 6d111bceb160..3c1eeab9749b 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -70,6 +70,13 @@ static inline bool rt_is_output_route(const struct rtable *rt)
return rt->rt_route_iif == 0;
}
+static inline __be32 rt_nexthop(const struct rtable *rt, __be32 daddr)
+{
+ if (rt->rt_gateway)
+ return rt->rt_gateway;
+ return daddr;
+}
+
struct ip_rt_acct {
__u32 o_bytes;
__u32 o_packets;