diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-02 13:16:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-02 13:16:06 -0500 |
commit | 15c054251ab84895ec043e90826612c1a3d6d4f1 (patch) | |
tree | 6c96a382d981ab7229665550be8332891f31f500 /include | |
parent | ccb7c410ddc054b8c1ae780319bc98ae092d3854 (diff) |
ipv6: Add rt6_get_peer() helper.
To go along side ipv4's rt_get_peer().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/ip6_route.h | 9 |
1 files changed, 9 insertions, 0 deletions
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) | |||
59 | extern void rt6_bind_peer(struct rt6_info *rt, | 59 | extern void rt6_bind_peer(struct rt6_info *rt, |
60 | int create); | 60 | int create); |
61 | 61 | ||
62 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | ||
63 | { | ||
64 | if (rt->rt6i_peer) | ||
65 | return rt->rt6i_peer; | ||
66 | |||
67 | rt6_bind_peer(rt, 0); | ||
68 | return rt->rt6i_peer; | ||
69 | } | ||
70 | |||
62 | extern void ip6_route_input(struct sk_buff *skb); | 71 | extern void ip6_route_input(struct sk_buff *skb); |
63 | 72 | ||
64 | extern struct dst_entry * ip6_route_output(struct net *net, | 73 | extern struct dst_entry * ip6_route_output(struct net *net, |