tcp: Fix a connect() race with timewait sockets
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 4 Dec 2009 03:46:54 +0000 (03:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Dec 2009 04:17:51 +0000 (20:17 -0800)
commit9327f7053e3993c125944fdb137a0618319ef2a0
tree3cee7de049a2468bef930b1832c42bd1b2e69e9a
parent74757d49016a8b06ca028196886641d7aeb78de5
tcp: Fix a connect() race with timewait sockets

First patch changes __inet_hash_nolisten() and __inet6_hash()
to get a timewait parameter to be able to unhash it from ehash
at same time the new socket is inserted in hash.

This makes sure timewait socket wont be found by a concurrent
writer in __inet_check_established()

Reported-by: kapil dakhane <kdakhane@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet6_hashtables.h
include/net/inet_hashtables.h
net/dccp/ipv4.c
net/dccp/ipv6.c
net/ipv4/inet_hashtables.c
net/ipv4/tcp_ipv4.c
net/ipv6/inet6_hashtables.c
net/ipv6/tcp_ipv6.c