Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fabcd71 authored by Daniel Lezcano's avatar Daniel Lezcano Committed by David S. Miller
Browse files

[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: default avatarDaniel Lezcano <dlezcano@fr.ibm.com>
Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e08b0998
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -79,7 +79,7 @@ extern struct nsproxy init_nsproxy;
	.nslock		= __SPIN_LOCK_UNLOCKED(nsproxy.nslock),		\
	.nslock		= __SPIN_LOCK_UNLOCKED(nsproxy.nslock),		\
	.uts_ns		= &init_uts_ns,					\
	.uts_ns		= &init_uts_ns,					\
	.mnt_ns		= NULL,						\
	.mnt_ns		= NULL,						\
	.net_ns		= &init_net,					\
	INIT_NET_NS(net_ns)                                             \
	INIT_IPC_NS(ipc_ns)						\
	INIT_IPC_NS(ipc_ns)						\
	.user_ns	= &init_user_ns,				\
	.user_ns	= &init_user_ns,				\
}
}
+7 −0
Original line number Original line Diff line number Diff line
@@ -28,7 +28,14 @@ struct net {
	struct hlist_head	*dev_index_head;
	struct hlist_head	*dev_index_head;
};
};


#ifdef CONFIG_NET
/* Init's network namespace */
extern struct net init_net;
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 struct list_head net_namespace_list;


extern void __put_net(struct net *net);
extern void __put_net(struct net *net);