diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-11-25 20:21:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 20:21:45 -0500 |
commit | 0331b1f383e1fa4049f8e75cafeea8f006171c64 (patch) | |
tree | 69409ab7c17e1527ed063bb4f2eda440e2cb4ea2 /include/net/xfrm.h | |
parent | 50a30657fd7ee77a94a6bf0ad86eba7c37c3032e (diff) |
netns xfrm: add struct xfrm_policy::xp_net
Again, to avoid complications with passing netns when not necessary.
Again, ->xp_net is set-once field, once set it never changes.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/xfrm.h')
-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 0d4353c11093..1ab17565f01c 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -475,6 +475,9 @@ struct xfrm_policy_walk { | |||
475 | 475 | ||
476 | struct xfrm_policy | 476 | struct xfrm_policy |
477 | { | 477 | { |
478 | #ifdef CONFIG_NET_NS | ||
479 | struct net *xp_net; | ||
480 | #endif | ||
478 | struct hlist_node bydst; | 481 | struct hlist_node bydst; |
479 | struct hlist_node byidx; | 482 | struct hlist_node byidx; |
480 | 483 | ||
@@ -499,6 +502,11 @@ struct xfrm_policy | |||
499 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; | 502 | struct xfrm_tmpl xfrm_vec[XFRM_MAX_DEPTH]; |
500 | }; | 503 | }; |
501 | 504 | ||
505 | static inline struct net *xp_net(struct xfrm_policy *xp) | ||
506 | { | ||
507 | return read_pnet(&xp->xp_net); | ||
508 | } | ||
509 | |||
502 | struct xfrm_kmaddress { | 510 | struct xfrm_kmaddress { |
503 | xfrm_address_t local; | 511 | xfrm_address_t local; |
504 | xfrm_address_t remote; | 512 | xfrm_address_t remote; |
@@ -1425,7 +1433,7 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb) | |||
1425 | } | 1433 | } |
1426 | #endif | 1434 | #endif |
1427 | 1435 | ||
1428 | struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); | 1436 | struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp); |
1429 | 1437 | ||
1430 | extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); | 1438 | extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); |
1431 | extern int xfrm_policy_walk(struct xfrm_policy_walk *walk, | 1439 | extern int xfrm_policy_walk(struct xfrm_policy_walk *walk, |