Skip to content

Commit

Permalink
inetpeer: Use correct AVL tree base pointer in inet_getpeer().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Jan 24, 2011
1 parent d1dc7ab commit 3408404
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/inetpeer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3408404

Please sign in to comment.