From: David S. Miller Date: Thu, 2 Dec 2010 18:16:06 +0000 (-0800) Subject: ipv6: Add rt6_get_peer() helper. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=15c054251ab84895ec043e90826612c1a3d6d4f1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ipv6: Add rt6_get_peer() helper. To go along side ipv4's rt_get_peer(). Signed-off-by: David S. Miller --- diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 23fed28db4bb..67d154a3f31b 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -59,6 +59,15 @@ static inline unsigned int rt6_flags2srcprefs(int flags) extern void rt6_bind_peer(struct rt6_info *rt, int create); +static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) +{ + if (rt->rt6i_peer) + return rt->rt6i_peer; + + rt6_bind_peer(rt, 0); + return rt->rt6i_peer; +} + extern void ip6_route_input(struct sk_buff *skb); extern struct dst_entry * ip6_route_output(struct net *net,