aboutsummaryrefslogtreecommitdiff
path: root/net/ipv6/icmp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-10 03:58:16 -0700
committerDavid S. Miller <davem@davemloft.net>2012-07-10 22:40:11 -0700
commit1d861aa4b3fb08822055345f480850205ffe6170 (patch)
tree072c23dcde7766274464c75e51e820649301ad82 /net/ipv6/icmp.c
parent16d1839907e695387654901995f9286b65fbbc6a (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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index c7da1422cbd..a113f7d7e93 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,
if (rt->rt6i_dst.plen < 128)
tmo >>= ((128 - rt->rt6i_dst.plen)>>5);
- peer = rt6_get_peer_create(rt);
+ peer = inet_getpeer_v6(net->ipv6.peers, &rt->rt6i_dst.addr, 1);
res = inet_peer_xrlim_allow(peer, tmo);
+ if (peer)
+ inet_putpeer(peer);
}
dst_release(dst);
return res;