[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 f8abfa3..e2c1ffc 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 ce06188..bec4485 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;