diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-09 02:24:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-09 02:24:18 -0400 |
commit | fbfe95a42e90b3dd079cc9019ba7d7700feee0f6 (patch) | |
tree | f5f16e6efcf1411a47df8b836f669fc452489dd4 /include/net/ip6_route.h | |
parent | 7123aaa3a1416529ce461e98108e6b343b294643 (diff) |
inet: Create and use rt{,6}_get_peer_create().
There's a lot of places that open-code rt{,6}_get_peer() only because
they want to set 'create' to one. So add an rt{,6}_get_peer_create()
for their sake.
There were also a few spots open-coding plain rt{,6}_get_peer() and
those are transformed here as well.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip6_route.h')
-rw-r--r-- | include/net/ip6_route.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 37c1a1ed82c1..73d750288121 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -53,18 +53,27 @@ static inline unsigned int rt6_flags2srcprefs(int flags) | |||
53 | return (flags >> 3) & 7; | 53 | return (flags >> 3) & 7; |
54 | } | 54 | } |
55 | 55 | ||
56 | extern void rt6_bind_peer(struct rt6_info *rt, | 56 | extern void rt6_bind_peer(struct rt6_info *rt, int create); |
57 | int create); | ||
58 | 57 | ||
59 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | 58 | static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create) |
60 | { | 59 | { |
61 | if (rt->rt6i_peer) | 60 | if (rt->rt6i_peer) |
62 | return rt->rt6i_peer; | 61 | return rt->rt6i_peer; |
63 | 62 | ||
64 | rt6_bind_peer(rt, 0); | 63 | rt6_bind_peer(rt, create); |
65 | return rt->rt6i_peer; | 64 | return rt->rt6i_peer; |
66 | } | 65 | } |
67 | 66 | ||
67 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | ||
68 | { | ||
69 | return __rt6_get_peer(rt, 0); | ||
70 | } | ||
71 | |||
72 | static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt) | ||
73 | { | ||
74 | return __rt6_get_peer(rt, 1); | ||
75 | } | ||
76 | |||
68 | extern void ip6_route_input(struct sk_buff *skb); | 77 | extern void ip6_route_input(struct sk_buff *skb); |
69 | 78 | ||
70 | extern struct dst_entry * ip6_route_output(struct net *net, | 79 | extern struct dst_entry * ip6_route_output(struct net *net, |