diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-10 06:58:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-11 01:40:11 -0400 |
commit | 1d861aa4b3fb08822055345f480850205ffe6170 (patch) | |
tree | 072c23dcde7766274464c75e51e820649301ad82 /net/ipv6/icmp.c | |
parent | 16d1839907e695387654901995f9286b65fbbc6a (diff) |
inet: Minimize use of cached route inetpeer.
Only use it in the absolutely required cases:
1) COW'ing metrics
2) ipv4 PMTU
3) ipv4 redirects
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r-- | net/ipv6/icmp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index c7da1422cbde..a113f7d7e938 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -194,8 +194,10 @@ static inline bool icmpv6_xrlim_allow(struct sock *sk, u8 type, | |||
194 | if (rt->rt6i_dst.plen < 128) | 194 | if (rt->rt6i_dst.plen < 128) |
195 | tmo >>= ((128 - rt->rt6i_dst.plen)>>5); | 195 | tmo >>= ((128 - rt->rt6i_dst.plen)>>5); |
196 | 196 | ||
197 | peer = rt6_get_peer_create(rt); | 197 | peer = inet_getpeer_v6(net->ipv6.peers, &rt->rt6i_dst.addr, 1); |
198 | res = inet_peer_xrlim_allow(peer, tmo); | 198 | res = inet_peer_xrlim_allow(peer, tmo); |
199 | if (peer) | ||
200 | inet_putpeer(peer); | ||
199 | } | 201 | } |
200 | dst_release(dst); | 202 | dst_release(dst); |
201 | return res; | 203 | return res; |