Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux,ssh: set IP_BIND_ADDRESS_NO_PORT on connected socket
if binding to a local address (ssh -b ...) the source port is taken at bind() time when the kernel does not know if the socket will be connect()ed or listen()ed on. It also does not know the destination host or port so it has to reserve the port until the socket is closed, effectively limiting the number of useful source ports to ~32k. a very small number in the modern era. Set IP_BIND_ADDRESS_NO_PORT, which delays source port allocation to connect() time allowing a few million connections out from the same -b address.
- Loading branch information