diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net/xfrm.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 9107d6f5c297..9da89039832c 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -130,6 +130,9 @@ struct xfrm_state_walk { | |||
130 | /* Full description of state of transformer. */ | 130 | /* Full description of state of transformer. */ |
131 | struct xfrm_state | 131 | struct xfrm_state |
132 | { | 132 | { |
133 | #ifdef CONFIG_NET_NS | ||
134 | struct net *xs_net; | ||
135 | #endif | ||
133 | union { | 136 | union { |
134 | struct hlist_node gclist; | 137 | struct hlist_node gclist; |
135 | struct hlist_node bydst; | 138 | struct hlist_node bydst; |
@@ -223,6 +226,11 @@ struct xfrm_state | |||
223 | void *data; | 226 | void *data; |
224 | }; | 227 | }; |
225 | 228 | ||
229 | static inline struct net *xs_net(struct xfrm_state *x) | ||
230 | { | ||
231 | return read_pnet(&x->xs_net); | ||
232 | } | ||
233 | |||
226 | /* xflags - make enum if more show up */ | 234 | /* xflags - make enum if more show up */ |
227 | #define XFRM_TIME_DEFER 1 | 235 | #define XFRM_TIME_DEFER 1 |
228 | 236 | ||
@@ -1296,7 +1304,7 @@ extern void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); | |||
1296 | extern int xfrm_state_walk(struct xfrm_state_walk *walk, | 1304 | extern int xfrm_state_walk(struct xfrm_state_walk *walk, |
1297 | int (*func)(struct xfrm_state *, int, void*), void *); | 1305 | int (*func)(struct xfrm_state *, int, void*), void *); |
1298 | extern void xfrm_state_walk_done(struct xfrm_state_walk *walk); | 1306 | extern void xfrm_state_walk_done(struct xfrm_state_walk *walk); |
1299 | extern struct xfrm_state *xfrm_state_alloc(void); | 1307 | extern struct xfrm_state *xfrm_state_alloc(struct net *net); |
1300 | extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | 1308 | extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, |
1301 | struct flowi *fl, struct xfrm_tmpl *tmpl, | 1309 | struct flowi *fl, struct xfrm_tmpl *tmpl, |
1302 | struct xfrm_policy *pol, int *err, | 1310 | struct xfrm_policy *pol, int *err, |