aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/net/net_namespace.h7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index e2c1ffcff62c..513bc3e489f0 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 fac42db7f6d0..3081b6ed35fe 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);