Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: ipv6: bind() use stronger condition for bind_conflict
@ 2013-03-05 18:11 Flavio Leitner
  2013-03-06  4:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Flavio Leitner @ 2013-03-05 18:11 UTC (permalink / raw)
  To: netdev; +Cc: Hideaki YOSHIFUJI, Flavio Leitner

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>
---
 net/ipv6/inet6_connection_sock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index b386a2c..f7f49bf 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -55,6 +55,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;
 		}
 	}
 
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-06  4:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05 18:11 [PATCH net-next] tcp: ipv6: bind() use stronger condition for bind_conflict Flavio Leitner
2013-03-06  4:54 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox