diff options
author | Flavio Leitner <fbl@redhat.com> | 2013-03-05 08:11:01 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-05 23:40:00 -0500 |
commit | dd9f319d94c99b96fc9b34ccde7389a91059fe31 (patch) | |
tree | 8b9869b2897fc7ee32076445cd2ba679e3276bd8 | |
parent | fae4f3cf49ac9d91b83c705809d71fdeb0dc9284 (diff) | |
download | linux-dd9f319d94c99b96fc9b34ccde7389a91059fe31.tar.gz linux-dd9f319d94c99b96fc9b34ccde7389a91059fe31.tar.bz2 linux-dd9f319d94c99b96fc9b34ccde7389a91059fe31.zip |
tcp: ipv6: bind() use stronger condition for bind_conflict
We must try harder to get unique (addr, port) pairs when
doing port autoselection for sockets with SO_REUSEADDR
option set.
This is a continuation of commit aacd9289af8b82f5fb01bcdd53d0e3406d1333c7
for IPv6.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv6/inet6_connection_sock.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 9bfab19ff3c0..5f25510f584e 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c @@ -54,6 +54,10 @@ int inet6_csk_bind_conflict(const struct sock *sk, if (ipv6_rcv_saddr_equal(sk, sk2)) break; } + if (!relax && reuse && sk2->sk_reuse && + sk2->sk_state != TCP_LISTEN && + ipv6_rcv_saddr_equal(sk, sk2)) + break; } } |