summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-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 6d111bc..3c1eeab 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;
OpenPOWER on IntegriCloud