diff options
-rw-r--r-- | net/sysctl_net.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/sysctl_net.c b/net/sysctl_net.c index 3865c4f76b82..2b2986dd04ae 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c | |||
@@ -88,9 +88,18 @@ static struct pernet_operations sysctl_pernet_ops = { | |||
88 | .exit = sysctl_net_exit, | 88 | .exit = sysctl_net_exit, |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static struct ctl_table_header *net_header; | ||
91 | static __init int net_sysctl_init(void) | 92 | static __init int net_sysctl_init(void) |
92 | { | 93 | { |
93 | int ret; | 94 | static struct ctl_table empty[1]; |
95 | int ret = -ENOMEM; | ||
96 | /* Avoid limitations in the sysctl implementation by | ||
97 | * registering "/proc/sys/net" as an empty directory not in a | ||
98 | * network namespace. | ||
99 | */ | ||
100 | net_header = register_sysctl("net", empty); | ||
101 | if (!net_header) | ||
102 | goto out; | ||
94 | ret = register_pernet_subsys(&sysctl_pernet_ops); | 103 | ret = register_pernet_subsys(&sysctl_pernet_ops); |
95 | if (ret) | 104 | if (ret) |
96 | goto out; | 105 | goto out; |