]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Allow TCP to reuse local port with different destinations
authorMike Karels <karels@FreeBSD.org>
Mon, 18 May 2020 22:53:12 +0000 (22:53 +0000)
committerMike Karels <karels@FreeBSD.org>
Mon, 18 May 2020 22:53:12 +0000 (22:53 +0000)
commit2510235150927f9f2137261f7afdee04e7277cd8
tree933c3aaaa1fd7fdc0f177346c3cb69ef987da60e
parent6863ab0b8b26de4f06021f90fa64eff5922b4484
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