aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/route.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/route.h')
-rw-r--r--include/net/route.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/net/route.h b/include/net/route.h
index ed2b78e2375d..433fc6c1d404 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -296,15 +296,25 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable
296 296
297extern void rt_bind_peer(struct rtable *rt, __be32 daddr, int create); 297extern void rt_bind_peer(struct rtable *rt, __be32 daddr, int create);
298 298
299static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr) 299static inline struct inet_peer *__rt_get_peer(struct rtable *rt, __be32 daddr, int create)
300{ 300{
301 if (rt->peer) 301 if (rt->peer)
302 return rt->peer; 302 return rt->peer;
303 303
304 rt_bind_peer(rt, daddr, 0); 304 rt_bind_peer(rt, daddr, create);
305 return rt->peer; 305 return rt->peer;
306} 306}
307 307
308static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr)
309{
310 return __rt_get_peer(rt, daddr, 0);
311}
312
313static inline struct inet_peer *rt_get_peer_create(struct rtable *rt, __be32 daddr)
314{
315 return __rt_get_peer(rt, daddr, 1);
316}
317
308static inline int inet_iif(const struct sk_buff *skb) 318static inline int inet_iif(const struct sk_buff *skb)
309{ 319{
310 return skb_rtable(skb)->rt_iif; 320 return skb_rtable(skb)->rt_iif;