aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 14c50a1650ef..512bcd5dabac 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -208,11 +208,19 @@ static inline u64 snmp_fold_field64(void __percpu *mib, int offt, size_t syncp_o
208 208
209void inet_get_local_port_range(struct net *net, int *low, int *high); 209void inet_get_local_port_range(struct net *net, int *low, int *high);
210 210
211extern unsigned long *sysctl_local_reserved_ports; 211#if CONFIG_SYSCTL
212static inline int inet_is_reserved_local_port(int port) 212static inline int inet_is_local_reserved_port(struct net *net, int port)
213{ 213{
214 return test_bit(port, sysctl_local_reserved_ports); 214 if (!net->ipv4.sysctl_local_reserved_ports)
215 return 0;
216 return test_bit(port, net->ipv4.sysctl_local_reserved_ports);
215} 217}
218#else
219static inline int inet_is_local_reserved_port(struct net *net, int port)
220{
221 return 0;
222}
223#endif
216 224
217extern int sysctl_ip_nonlocal_bind; 225extern int sysctl_ip_nonlocal_bind;
218 226