diff options
author | Eric W. Biederman | 2012-04-19 15:20:32 +0200 |
---|---|---|
committer | David S. Miller | 2012-04-21 03:21:16 +0200 |
commit | 2ca794e5e86c800d7f98c4ebb8bd325099c0afe8 (patch) | |
tree | f0ae38f58dec5a07ae57e31aca4943c85ffe9d65 /net | |
parent | net sysctl: Register an empty /proc/sys/net (diff) | |
download | kernel-qcow2-linux-2ca794e5e86c800d7f98c4ebb8bd325099c0afe8.tar.gz kernel-qcow2-linux-2ca794e5e86c800d7f98c4ebb8bd325099c0afe8.tar.xz kernel-qcow2-linux-2ca794e5e86c800d7f98c4ebb8bd325099c0afe8.zip |
net sysctl: Initialize the network sysctls sooner to avoid problems.
If the netfilter code is modified to use register_net_sysctl_table the
kernel fails to boot because the per net sysctl infrasturce is not setup
soon enough. So to avoid races call net_sysctl_init from sock_init().
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/socket.c | 6 | ||||
-rw-r--r-- | net/sysctl_net.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c index d6c1af9ae7b2..e34510928dcc 100644 --- a/net/socket.c +++ b/net/socket.c @@ -2524,6 +2524,12 @@ EXPORT_SYMBOL(sock_unregister); static int __init sock_init(void) { int err; + /* + * Initialize the network sysctl infrastructure. + */ + err = net_sysctl_init(); + if (err) + goto out; /* * Initialize sock SLAB cache. diff --git a/net/sysctl_net.c b/net/sysctl_net.c index 2b2986dd04ae..ce97237b653f 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c @@ -89,7 +89,7 @@ static struct pernet_operations sysctl_pernet_ops = { }; static struct ctl_table_header *net_header; -static __init int net_sysctl_init(void) +__init int net_sysctl_init(void) { static struct ctl_table empty[1]; int ret = -ENOMEM; @@ -109,7 +109,6 @@ static __init int net_sysctl_init(void) out: return ret; } -subsys_initcall(net_sysctl_init); struct ctl_table_header *register_net_sysctl_table(struct net *net, const struct ctl_path *path, struct ctl_table *table) |