net: reserve ports for applications using fixed port numbers
(Dropped the infiniband part, because Tetsuo modified the related code, I will send a separate patch for it once this is accepted.) This patch introduces /proc/sys/net/ipv4/ip_local_reserved_ports which allows users to reserve ports for third-party applications. The reserved ports will not be used by automatic port assignments (e.g. when calling connect() or bind() with port number 0). Explicit port allocation behavior is unchanged. Signed-off-by: Octavian Purdila <opurdila@ixiacom.com> Signed-off-by: WANG Cong <amwang@redhat.com> Cc: Neil Horman <nhorman@tuxdriver.com> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9f977fb7ae
commit
e3826f1e94
8 changed files with 73 additions and 2 deletions
|
@ -184,6 +184,12 @@ extern struct local_ports {
|
|||
} sysctl_local_ports;
|
||||
extern void inet_get_local_port_range(int *low, int *high);
|
||||
|
||||
extern unsigned long *sysctl_local_reserved_ports;
|
||||
static inline int inet_is_reserved_local_port(int port)
|
||||
{
|
||||
return test_bit(port, sysctl_local_reserved_ports);
|
||||
}
|
||||
|
||||
extern int sysctl_ip_default_ttl;
|
||||
extern int sysctl_ip_nonlocal_bind;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue