summaryrefslogtreecommitdiffstats
path: root/net/ipv4/inetpeer.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-01-24 14:37:46 -0800
committerDavid S. Miller <davem@davemloft.net>2011-01-24 14:38:09 -0800
commit3408404a4c2a4eead9d73b0bbbfe3f225b65f492 (patch)
treeb0be5af0a2886a3f5bc075d94c4c621ff6802973 /net/ipv4/inetpeer.c
parentd1dc7abf2fafa34b0ffcd070fd59405aa9c0a4d8 (diff)
downloadop-kernel-dev-3408404a4c2a4eead9d73b0bbbfe3f225b65f492.zip
op-kernel-dev-3408404a4c2a4eead9d73b0bbbfe3f225b65f492.tar.gz
inetpeer: Use correct AVL tree base pointer in inet_getpeer().
Family was hard-coded to AF_INET but should be daddr->family. This fixes crashes when unlinking ipv6 peer entries, since the unlink code was looking up the base pointer properly. Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inetpeer.c')
-rw-r--r--net/ipv4/inetpeer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index d9bc857..a96e656 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -475,7 +475,7 @@ static int cleanup_once(unsigned long ttl)
struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create)
{
struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr;
- struct inet_peer_base *base = family_to_base(AF_INET);
+ struct inet_peer_base *base = family_to_base(daddr->family);
struct inet_peer *p;
/* Look up for the address quickly, lockless.
OpenPOWER on IntegriCloud