summaryrefslogtreecommitdiffstats
path: root/include/net/inet6_hashtables.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-12-04 03:46:54 +0000
committerDavid S. Miller <davem@davemloft.net>2009-12-08 20:17:51 -0800
commit9327f7053e3993c125944fdb137a0618319ef2a0 (patch)
tree3cee7de049a2468bef930b1832c42bd1b2e69e9a /include/net/inet6_hashtables.h
parent74757d49016a8b06ca028196886641d7aeb78de5 (diff)
downloadop-kernel-dev-9327f7053e3993c125944fdb137a0618319ef2a0.zip
op-kernel-dev-9327f7053e3993c125944fdb137a0618319ef2a0.tar.gz
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>
Diffstat (limited to 'include/net/inet6_hashtables.h')
-rw-r--r--include/net/inet6_hashtables.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 92838d3..e46674d 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -53,7 +53,7 @@ static inline int inet6_sk_ehashfn(const struct sock *sk)
return inet6_ehashfn(net, laddr, lport, faddr, fport);
}
-extern void __inet6_hash(struct sock *sk);
+extern int __inet6_hash(struct sock *sk, struct inet_timewait_sock *twp);
/*
* Sockets in TCP_CLOSE state are _always_ taken out of the hash, so
OpenPOWER on IntegriCloud