]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Allow TCP to reuse local port with different destinations
authorkarels <karels@FreeBSD.org>
Mon, 18 May 2020 22:53:12 +0000 (22:53 +0000)
committerkarels <karels@FreeBSD.org>
Mon, 18 May 2020 22:53:12 +0000 (22:53 +0000)
commit738968b552d0ef05231688f9b4eb34746c0102d7
tree933c3aaaa1fd7fdc0f177346c3cb69ef987da60e
parentd7c7261fd4532f4f720372fd9917d324bcc2abdb
Allow TCP to reuse local port with different destinations

Previously, tcp_connect() would bind a local port before connecting,
forcing the local port to be unique across all outgoing TCP connections
for the address family. Instead, choose a local port after selecting
the destination and the local address, requiring only that the tuple
is unique and does not match a wildcard binding.

Reviewed by: tuexen (rscheff, rrs previous version)
MFC after: 1 month
Sponsored by: Forcepoint LLC
Differential Revision: https://reviews.freebsd.org/D24781
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet/tcp_usrreq.c
sys/netinet6/in6_pcb.c
sys/netinet6/in6_pcb.h