diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2014-05-12 19:04:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-14 15:31:45 -0400 |
commit | 122ff243f5f104194750ecbc76d5946dd1eec934 (patch) | |
tree | 189020a4d2404ef567785458fee38992e14ca97d /net/ipv4/af_inet.c | |
parent | 9cc5e36d1c4794939deafd9f43bce2eab9c1142d (diff) |
ipv4: make ip_local_reserved_ports per netns
ip_local_port_range is already per netns, so should ip_local_reserved_ports
be. And since it is none by default we don't actually need it when we don't
enable CONFIG_SYSCTL.
By the way, rename inet_is_reserved_local_port() to inet_is_local_reserved_port()
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 211c0cc6c3d3..279132bcadd9 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1705,13 +1705,9 @@ static int __init inet_init(void) | |||
1705 | 1705 | ||
1706 | BUILD_BUG_ON(sizeof(struct inet_skb_parm) > FIELD_SIZEOF(struct sk_buff, cb)); | 1706 | BUILD_BUG_ON(sizeof(struct inet_skb_parm) > FIELD_SIZEOF(struct sk_buff, cb)); |
1707 | 1707 | ||
1708 | sysctl_local_reserved_ports = kzalloc(65536 / 8, GFP_KERNEL); | ||
1709 | if (!sysctl_local_reserved_ports) | ||
1710 | goto out; | ||
1711 | |||
1712 | rc = proto_register(&tcp_prot, 1); | 1708 | rc = proto_register(&tcp_prot, 1); |
1713 | if (rc) | 1709 | if (rc) |
1714 | goto out_free_reserved_ports; | 1710 | goto out; |
1715 | 1711 | ||
1716 | rc = proto_register(&udp_prot, 1); | 1712 | rc = proto_register(&udp_prot, 1); |
1717 | if (rc) | 1713 | if (rc) |
@@ -1821,8 +1817,6 @@ out_unregister_udp_proto: | |||
1821 | proto_unregister(&udp_prot); | 1817 | proto_unregister(&udp_prot); |
1822 | out_unregister_tcp_proto: | 1818 | out_unregister_tcp_proto: |
1823 | proto_unregister(&tcp_prot); | 1819 | proto_unregister(&tcp_prot); |
1824 | out_free_reserved_ports: | ||
1825 | kfree(sysctl_local_reserved_ports); | ||
1826 | goto out; | 1820 | goto out; |
1827 | } | 1821 | } |
1828 | 1822 | ||