From bd7b1533cd6a68c734062aa69394bec7e2b1718e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 15 Jul 2008 16:00:59 -0400 Subject: [PATCH] sysctl: make sure that /proc/sys/net/ipv4 appears before per-ns ones Massage ipv4 initialization - make sure that net.ipv4 appears as non-per-net-namespace before it shows up in per-net-namespace sysctls. That's the only change outside of sysctl.c needed to get sane ordering rules and data structures for sysctls (esp. for procfs side of that mess). Signed-off-by: Al Viro --- net/ipv4/af_inet.c | 4 ++++ net/ipv4/sysctl_net_ipv4.c | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'net/ipv4') diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index f440a9f54924..354f6b54e492 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1439,6 +1439,10 @@ static int __init inet_init(void) (void)sock_register(&inet_family_ops); +#ifdef CONFIG_SYSCTL + ip_static_sysctl_init(); +#endif + /* * Add all the base protocols. */ diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 14ef202a2254..d63e9388d92d 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -882,4 +882,11 @@ static __init int sysctl_ipv4_init(void) return 0; } +/* set enough of tree skeleton to get rid of ordering problems */ +void __init ip_static_sysctl_init(void) +{ + static ctl_table table[1]; + register_sysctl_paths(net_ipv4_ctl_path, table); +} + __initcall(sysctl_ipv4_init); -- cgit v1.2.3-55-g7522