[NETNS]: Fix allnoconfig compilation error.
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 13 Sep 2007 07:16:29 +0000 (09:16 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:49:21 +0000 (16:49 -0700)
When CONFIG_NET=no, init_net is unresolved because net_namespace.c
is not compiled and the include pull init_net definition.

This problem was very similar with the ipc namespace where the kernel
can be compiled with SYSV ipc out.

This patch fix that defining a macro which simply remove init_net
initialization from nsproxy namespace aggregator.

Compiled and booted on qemu-i386 with CONFIG_NET=no and CONFIG_NET=yes.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/init_task.h
include/net/net_namespace.h

index e2c1ffcff62cea6d363b0a06ec47e4894d8ccda8..513bc3e489f018f33495867568d708a9335b0c06 100644 (file)
@@ -79,7 +79,7 @@ extern struct nsproxy init_nsproxy;
        .nslock         = __SPIN_LOCK_UNLOCKED(nsproxy.nslock),         \
        .uts_ns         = &init_uts_ns,                                 \
        .mnt_ns         = NULL,                                         \
-       .net_ns         = &init_net,                                    \
+       INIT_NET_NS(net_ns)                                             \
        INIT_IPC_NS(ipc_ns)                                             \
        .user_ns        = &init_user_ns,                                \
 }
index fac42db7f6d0772b8d2fbd3c93bb075a5b7f2577..3081b6ed35fe3930157e3e5c1289a544ef7a0a8e 100644 (file)
@@ -28,7 +28,14 @@ struct net {
        struct hlist_head       *dev_index_head;
 };
 
+#ifdef CONFIG_NET
+/* Init's network namespace */
 extern struct net init_net;
+#define INIT_NET_NS(net_ns) .net_ns = &init_net,
+#else
+#define INIT_NET_NS(net_ns)
+#endif
+
 extern struct list_head net_namespace_list;
 
 extern void __put_net(struct net *net);