lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 25 Jan 2007 12:00:08 -0700 From: "Eric W. Biederman" <ebiederm@...ssion.com> To: <netdev@...r.kernel.org> Cc: <containers@...ts.osdl.org>, <openib-general@...nib.org>, "Eric W. Biederman" <ebiederm@...ssion.com> Subject: [PATCH RFC 6/31] net: Add a helper to get a reference to the initial network namespace. From: Eric W. Biederman <ebiederm@...ssion.com> - unquoted The initial network namespace is special and we need to use it for various things. Probably the biggest initial use will be to ensure code that can't cope with multiple namespaces only sees the initial network namespace. For that reason and because getting at the initial network namespace is just a little clumsy add a helper function. Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com> --- include/net/net_namespace.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 06a9ba1..9208e2e 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -27,6 +27,12 @@ struct net_namespace_head { struct work_struct work; }; +/* Get the initial network namespace */ +static inline net_t init_net(void) +{ + return init_nsproxy.net_ns; +} + static inline net_t get_net(net_t net) { return net; } static inline void put_net(net_t net) {} static inline net_t hold_net(net_t net) { return net; } -- 1.4.4.1.g278f - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists