]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/xfrm.h
netns xfrm: add struct xfrm_policy::xp_net
[linux-2.6-omap-h63xx.git] / include / net / xfrm.h
index 0d4353c11093532a14f25f6cfc4e11ede1e04732..1ab17565f01c714f97657e7c6e3fdea8d8f21c0e 100644 (file)
@@ -475,6 +475,9 @@ struct xfrm_policy_walk {
 
 struct xfrm_policy
 {
+#ifdef CONFIG_NET_NS
+       struct net              *xp_net;
+#endif
        struct hlist_node       bydst;
        struct hlist_node       byidx;
 
@@ -499,6 +502,11 @@ struct xfrm_policy
        struct xfrm_tmpl        xfrm_vec[XFRM_MAX_DEPTH];
 };
 
+static inline struct net *xp_net(struct xfrm_policy *xp)
+{
+       return read_pnet(&xp->xp_net);
+}
+
 struct xfrm_kmaddress {
        xfrm_address_t          local;
        xfrm_address_t          remote;
@@ -1425,7 +1433,7 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
 }
 #endif
 
-struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp);
+struct xfrm_policy *xfrm_policy_alloc(struct net *net, gfp_t gfp);
 
 extern void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type);
 extern int xfrm_policy_walk(struct xfrm_policy_walk *walk,