]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/net_namespace.c
Merge branch 'fixes-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
[linux-2.6-omap-h63xx.git] / net / core / net_namespace.c
index 3f6d37deac4505f6bf75d4a43749fc08b3013091..383252b50411b89c5c18835bcbe4c9837ed16ad0 100644 (file)
@@ -188,6 +188,7 @@ static int __init net_ns_init(void)
 
 pure_initcall(net_ns_init);
 
+#ifdef CONFIG_NET_NS
 static int register_pernet_operations(struct list_head *list,
                                      struct pernet_operations *ops)
 {
@@ -228,6 +229,23 @@ static void unregister_pernet_operations(struct pernet_operations *ops)
                        ops->exit(net);
 }
 
+#else
+
+static int register_pernet_operations(struct list_head *list,
+                                     struct pernet_operations *ops)
+{
+       if (ops->init == NULL)
+               return 0;
+       return ops->init(&init_net);
+}
+
+static void unregister_pernet_operations(struct pernet_operations *ops)
+{
+       if (ops->exit)
+               ops->exit(&init_net);
+}
+#endif
+
 /**
  *      register_pernet_subsys - register a network namespace subsystem
  *     @ops:  pernet operations structure for the subsystem