diff options
| author | Eric Dumazet <[email protected]> | 2009-12-04 03:46:54 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2009-12-09 04:17:51 +0000 |
| commit | 9327f7053e3993c125944fdb137a0618319ef2a0 (patch) | |
| tree | 3cee7de049a2468bef930b1832c42bd1b2e69e9a /net/ipv4/tcp_ipv4.c | |
| parent | ixgbe: add support for 82599 KR device 0x1517 (diff) | |
| download | kernel-9327f7053e3993c125944fdb137a0618319ef2a0.tar.gz kernel-9327f7053e3993c125944fdb137a0618319ef2a0.zip | |
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 <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 29002ab26e0d..15e96030ce47 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1464,7 +1464,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, } #endif - __inet_hash_nolisten(newsk); + __inet_hash_nolisten(newsk, NULL); __inet_inherit_port(sk, newsk); return newsk; |
