IP_BIND_ADDRESS_NO_PORT(2const)

NAME
IP_BIND_ADDRESS_NO_PORT - don't reserve an ephemeral port

LIBRARY
Standard C library (libc, -lc)

SYNOPSIS
#include <netinet/in.h>  /* Definition of IP* constants */
#include <sys/socket.h>

int setsockopt(int sockfd, IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT,
               const int *enable, sizeof(int));

DESCRIPTION
Inform the kernel to not reserve an ephemeral port when using bind(2) with a port number of 0. The port will later be automatically chosen at connect(2) time, in a way that allows sharing a source port as long as the 4-tuple is unique.

ERRORS
See IPPROTO_IP(2const). See setsockopt(2). See ip(7).

HISTORY
Linux 4.2.

SEE ALSO
IPPROTO_IP(2const), setsockopt(2), ip(7)