Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd9f319d authored by Flavio Leitner's avatar Flavio Leitner Committed by David S. Miller
Browse files

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 aacd9289
for IPv6.

Signed-off-by: default avatarFlavio Leitner <fbl@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fae4f3cf
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -54,6 +54,10 @@ int inet6_csk_bind_conflict(const struct sock *sk,
				if (ipv6_rcv_saddr_equal(sk, sk2))
				if (ipv6_rcv_saddr_equal(sk, sk2))
					break;
					break;
			}
			}
			if (!relax && reuse && sk2->sk_reuse &&
			    sk2->sk_state != TCP_LISTEN &&
			    ipv6_rcv_saddr_equal(sk, sk2))
				break;
		}
		}
	}
	}