aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/icmp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-09 02:24:18 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-09 02:24:18 -0400
commitfbfe95a42e90b3dd079cc9019ba7d7700feee0f6 (patch)
treef5f16e6efcf1411a47df8b836f669fc452489dd4 /net/ipv6/icmp.c
parent7123aaa3a1416529ce461e98108e6b343b294643 (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 'net/ipv6/icmp.c')
-rw-r--r--net/ipv6/icmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 091a2971c7b7..ed89bba745a1 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -188,14 +188,14 @@ static inline bool icmpv6_xrlim_allow(struct sock *sk, u8 type,
188 } else { 188 } else {
189 struct rt6_info *rt = (struct rt6_info *)dst; 189 struct rt6_info *rt = (struct rt6_info *)dst;
190 int tmo = net->ipv6.sysctl.icmpv6_time; 190 int tmo = net->ipv6.sysctl.icmpv6_time;
191 struct inet_peer *peer;
191 192
192 /* Give more bandwidth to wider prefixes. */ 193 /* Give more bandwidth to wider prefixes. */
193 if (rt->rt6i_dst.plen < 128) 194 if (rt->rt6i_dst.plen < 128)
194 tmo >>= ((128 - rt->rt6i_dst.plen)>>5); 195 tmo >>= ((128 - rt->rt6i_dst.plen)>>5);
195 196
196 if (!rt->rt6i_peer) 197 peer = rt6_get_peer_create(rt);
197 rt6_bind_peer(rt, 1); 198 res = inet_peer_xrlim_allow(peer, tmo);
198 res = inet_peer_xrlim_allow(rt->rt6i_peer, tmo);
199 } 199 }
200 dst_release(dst); 200 dst_release(dst);
201 return res; 201 return res;