From 2ca794e5e86c800d7f98c4ebb8bd325099c0afe8 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Thu, 19 Apr 2012 13:20:32 +0000 Subject: 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 Acked-by: Pavel Emelyanov Signed-off-by: David S. Miller --- net/socket.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'net/socket.c') diff --git a/net/socket.c b/net/socket.c index d6c1af9ae7b..e34510928dc 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. -- cgit v1.2.3-18-g5258