Skip to content

gsocketclient: set IP_BIND_ADDRESS_NO_PORT if binding to local address

The linux kernel does not know that the socket will be used for connect or listen and if you bind() to a local address it must reserve a random port (if port == 0) at bind() time, making very easy to exhaust the ~32k port range, setting IP_BIND_ADDRESS_NO_PORT tells the kernel to choose random port at connect() time instead, when the full 4-tuple is known.

Merge request reports

Loading