diff options
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r-- | include/net/net_namespace.h | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 923f2b8b909..6c9a48a4668 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -8,6 +8,7 @@ #include <linux/workqueue.h> #include <linux/list.h> +#include <net/netns/core.h> #include <net/netns/unix.h> #include <net/netns/packet.h> #include <net/netns/ipv4.h> @@ -46,10 +47,7 @@ struct net { struct sock *rtnl; /* rtnetlink socket */ - /* core sysctls */ - struct ctl_table_header *sysctl_core_hdr; - int sysctl_somaxconn; - + struct netns_core core; struct netns_packet packet; struct netns_unix unx; struct netns_ipv4 ipv4; @@ -61,25 +59,29 @@ struct net { #endif }; + #ifdef CONFIG_NET +#include <linux/seq_file_net.h> + /* 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; - -#ifdef CONFIG_NET extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); -#else + +#else /* CONFIG_NET */ + +#define INIT_NET_NS(net_ns) + static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) { /* There is nothing to copy so this is a noop */ return net_ns; } -#endif +#endif /* CONFIG_NET */ + + +extern struct list_head net_namespace_list; #ifdef CONFIG_NET_NS extern void __put_net(struct net *net); @@ -118,6 +120,12 @@ static inline void release_net(struct net *net) { atomic_dec(&net->use_count); } + +static inline +int net_eq(const struct net *net1, const struct net *net2) +{ + return net1 == net2; +} #else static inline struct net *get_net(struct net *net) { @@ -141,6 +149,12 @@ static inline struct net *maybe_get_net(struct net *net) { return net; } + +static inline +int net_eq(const struct net *net1, const struct net *net2) +{ + return 1; +} #endif #define for_each_net(VAR) \ |