[NET]: Add a network namespace parameter to tasks
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 12 Sep 2007 09:55:17 +0000 (11:55 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:49:04 +0000 (16:49 -0700)
This is the network namespace from which all which all sockets
and anything else under user control ultimately get their network
namespace parameters.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/init_task.h
include/linux/nsproxy.h

index f8abfa349ef924344a11b1fd9739e68bd4d72b24..e2c1ffcff62cea6d363b0a06ec47e4894d8ccda8 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/ipc.h>
 #include <linux/pid_namespace.h>
 #include <linux/user_namespace.h>
+#include <net/net_namespace.h>
 
 #define INIT_FDTABLE \
 {                                                      \
@@ -78,6 +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_IPC_NS(ipc_ns)                                             \
        .user_ns        = &init_user_ns,                                \
 }
index ce06188b7a56796cb63736a7d03f62f7c623b10c..bec4485e3d76d0a91cba665b4716e5a6480bb42e 100644 (file)
@@ -29,6 +29,7 @@ struct nsproxy {
        struct mnt_namespace *mnt_ns;
        struct pid_namespace *pid_ns;
        struct user_namespace *user_ns;
+       struct net           *net_ns;
 };
 extern struct nsproxy init_nsproxy;