diff options
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 14 |
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 | ||
297 | extern void rt_bind_peer(struct rtable *rt, __be32 daddr, int create); | 297 | extern void rt_bind_peer(struct rtable *rt, __be32 daddr, int create); |
298 | 298 | ||
299 | static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr) | 299 | static 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 | ||
308 | static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr) | ||
309 | { | ||
310 | return __rt_get_peer(rt, daddr, 0); | ||
311 | } | ||
312 | |||
313 | static inline struct inet_peer *rt_get_peer_create(struct rtable *rt, __be32 daddr) | ||
314 | { | ||
315 | return __rt_get_peer(rt, daddr, 1); | ||
316 | } | ||
317 | |||
308 | static inline int inet_iif(const struct sk_buff *skb) | 318 | static 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; |