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>
struct ctl_table;
struct ctl_table_header;
+#ifdef CONFIG_SYSCTL
+extern int net_sysctl_init(void);
+#else
+static inline int net_sysctl_init(void) { return 0; }
+#endif
extern struct ctl_table_header *register_net_sysctl_table(struct net *net,
const struct ctl_path *path, struct ctl_table *table);
extern struct ctl_table_header *register_net_sysctl_rotable(
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.
};
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;
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)