[PATCH] sysctl: make sure that /proc/sys/net/ipv4 appears before per-ns ones
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 15 Jul 2008 20:00:59 +0000 (16:00 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 27 Jul 2008 00:53:10 +0000 (20:53 -0400)
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 <viro@zeniv.linux.org.uk>
include/net/ip.h
net/ipv4/af_inet.c
net/ipv4/sysctl_net_ipv4.c

index b5862b975207950c91e0af30b361b63c86fcd0db..250e6ef025a460e16e58636645a71cd51dbce887 100644 (file)
@@ -188,6 +188,8 @@ extern int sysctl_ip_dynaddr;
 
 extern void ipfrag_init(void);
 
+extern void ip_static_sysctl_init(void);
+
 #ifdef CONFIG_INET
 #include <net/dst.h>
 
index f440a9f54924e8d802b55d4bd59170c10b28d666..354f6b54e492c2a19bf8cc67cd5f8ce54dbae4d0 100644 (file)
@@ -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.
         */
index 14ef202a2254f21a57e4c7e5dfdd666e8ef65e63..d63e9388d92dfff616e432de6d0d4a27f3f6bfdb 100644 (file)
@@ -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);