Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4fabcd7118162e36eea5c53e8895ecc13762bef3 Commit: 4fabcd7118162e36eea5c53e8895ecc13762bef3 Parent: e08b09983fe9cf379faf1aefdf9164268d4610e7 Author: Daniel Lezcano <[EMAIL PROTECTED]> AuthorDate: Thu Sep 13 09:16:29 2007 +0200 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Wed Oct 10 16:49:21 2007 -0700
[NETNS]: Fix allnoconfig compilation error. 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 <[EMAIL PROTECTED]> Acked-by: "Eric W. Biederman" <[EMAIL PROTECTED]> Signed-off-by: David S. Miller <[EMAIL PROTECTED]> --- include/linux/init_task.h | 2 +- include/net/net_namespace.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/include/linux/init_task.h b/include/linux/init_task.h index e2c1ffc..513bc3e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -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, \ } diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index fac42db..3081b6e 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -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); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html