aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r--include/net/net_namespace.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 700c53a3c6fa..6fc13d905c5f 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -19,6 +19,7 @@
19#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 19#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
20#include <net/netns/conntrack.h> 20#include <net/netns/conntrack.h>
21#endif 21#endif
22#include <net/netns/xfrm.h>
22 23
23struct proc_dir_entry; 24struct proc_dir_entry;
24struct net_device; 25struct net_device;
@@ -74,6 +75,9 @@ struct net {
74 struct netns_ct ct; 75 struct netns_ct ct;
75#endif 76#endif
76#endif 77#endif
78#ifdef CONFIG_XFRM
79 struct netns_xfrm xfrm;
80#endif
77 struct net_generic *gen; 81 struct net_generic *gen;
78}; 82};
79 83
@@ -192,6 +196,24 @@ static inline void release_net(struct net *net)
192} 196}
193#endif 197#endif
194 198
199#ifdef CONFIG_NET_NS
200
201static inline void write_pnet(struct net **pnet, struct net *net)
202{
203 *pnet = net;
204}
205
206static inline struct net *read_pnet(struct net * const *pnet)
207{
208 return *pnet;
209}
210
211#else
212
213#define write_pnet(pnet, net) do { (void)(net);} while (0)
214#define read_pnet(pnet) (&init_net)
215
216#endif
195 217
196#define for_each_net(VAR) \ 218#define for_each_net(VAR) \
197 list_for_each_entry(VAR, &net_namespace_list, list) 219 list_for_each_entry(VAR, &net_namespace_list, list)