aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/net_namespace.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 3f6d37deac45..383252b50411 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -188,6 +188,7 @@ static int __init net_ns_init(void)
188 188
189pure_initcall(net_ns_init); 189pure_initcall(net_ns_init);
190 190
191#ifdef CONFIG_NET_NS
191static int register_pernet_operations(struct list_head *list, 192static int register_pernet_operations(struct list_head *list,
192 struct pernet_operations *ops) 193 struct pernet_operations *ops)
193{ 194{
@@ -228,6 +229,23 @@ static void unregister_pernet_operations(struct pernet_operations *ops)
228 ops->exit(net); 229 ops->exit(net);
229} 230}
230 231
232#else
233
234static int register_pernet_operations(struct list_head *list,
235 struct pernet_operations *ops)
236{
237 if (ops->init == NULL)
238 return 0;
239 return ops->init(&init_net);
240}
241
242static void unregister_pernet_operations(struct pernet_operations *ops)
243{
244 if (ops->exit)
245 ops->exit(&init_net);
246}
247#endif
248
231/** 249/**
232 * register_pernet_subsys - register a network namespace subsystem 250 * register_pernet_subsys - register a network namespace subsystem
233 * @ops: pernet operations structure for the subsystem 251 * @ops: pernet operations structure for the subsystem