aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h10
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
476struct xfrm_policy 476struct 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
505static inline struct net *xp_net(struct xfrm_policy *xp)
506{
507 return read_pnet(&xp->xp_net);
508}
509
502struct xfrm_kmaddress { 510struct 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
1428struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); 1436struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp);
1429 1437
1430extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type); 1438extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type);
1431extern int xfrm_policy_walk(struct xfrm_policy_walk *walk, 1439extern int xfrm_policy_walk(struct xfrm_policy_walk *walk,