HomeFreeBSD

Allow TCP to reuse local port with different destinations

Description

Allow TCP to reuse local port with different destinations

MFC r361228, r361231:

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.

Note that in_pcb_lport and in_pcb_lport_dest can be called with a NULL
local address for IPv6 sockets; handle it.

Sponsored by: Forcepoint LLC

Details

Provenance
karelsAuthored on
Parents
rS362445: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Branches
Unknown
Tags
Unknown