diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-10 03:58:16 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-10 22:40:11 -0700 |
commit | 1d861aa4b3fb08822055345f480850205ffe6170 (patch) | |
tree | 072c23dcde7766274464c75e51e820649301ad82 /net/ipv6/icmp.c | |
parent | 16d1839907e695387654901995f9286b65fbbc6a (diff) | |
download | linux-1d861aa4b3fb08822055345f480850205ffe6170.tar.bz2 |
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, 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; |