diff options
author | Amerigo Wang <amwang@redhat.com> | 2010-05-04 20:27:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-16 02:28:40 -0400 |
commit | e3826f1e946e7d2354943232f1457be1455a29e2 (patch) | |
tree | a34055c7de762410b6a10c21ab5e1999fb38803b /include | |
parent | 9f977fb7ae9ddf565b4800854212fb9a1ed6c2ea (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/ip.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index 8149b77cea9b..63548f0a44b1 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -184,6 +184,12 @@ extern struct local_ports { | |||
184 | } sysctl_local_ports; | 184 | } sysctl_local_ports; |
185 | extern void inet_get_local_port_range(int *low, int *high); | 185 | extern void inet_get_local_port_range(int *low, int *high); |
186 | 186 | ||
187 | extern unsigned long *sysctl_local_reserved_ports; | ||
188 | static inline int inet_is_reserved_local_port(int port) | ||
189 | { | ||
190 | return test_bit(port, sysctl_local_reserved_ports); | ||
191 | } | ||
192 | |||
187 | extern int sysctl_ip_default_ttl; | 193 | extern int sysctl_ip_default_ttl; |
188 | extern int sysctl_ip_nonlocal_bind; | 194 | extern int sysctl_ip_nonlocal_bind; |
189 | 195 | ||