netns xfrm: add struct xfrm_policy::xp_net
[safe/jmp/linux-2.6] / net / key / af_key.c
index 5b22e01..036315d 100644 (file)
@@ -1122,7 +1122,7 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr,
             (key->sadb_key_bits+7) / 8 > key->sadb_key_len * sizeof(uint64_t)))
                return ERR_PTR(-EINVAL);
 
-       x = xfrm_state_alloc();
+       x = xfrm_state_alloc(&init_net);
        if (x == NULL)
                return ERR_PTR(-ENOBUFS);
 
@@ -1411,7 +1411,7 @@ static int pfkey_acquire(struct sock *sk, struct sk_buff *skb, struct sadb_msg *
        spin_lock_bh(&x->lock);
        if (x->km.state == XFRM_STATE_ACQ) {
                x->km.state = XFRM_STATE_ERROR;
-               wake_up(&km_waitq);
+               wake_up(&init_net.xfrm.km_waitq);
        }
        spin_unlock_bh(&x->lock);
        xfrm_state_put(x);
@@ -2174,7 +2174,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
        if (!pol->sadb_x_policy_dir || pol->sadb_x_policy_dir >= IPSEC_DIR_MAX)
                return -EINVAL;
 
-       xp = xfrm_policy_alloc(GFP_KERNEL);
+       xp = xfrm_policy_alloc(&init_net, GFP_KERNEL);
        if (xp == NULL)
                return -ENOBUFS;
 
@@ -3141,7 +3141,7 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt,
            (!pol->sadb_x_policy_dir || pol->sadb_x_policy_dir > IPSEC_DIR_OUTBOUND))
                return NULL;
 
-       xp = xfrm_policy_alloc(GFP_ATOMIC);
+       xp = xfrm_policy_alloc(&init_net, GFP_ATOMIC);
        if (xp == NULL) {
                *dir = -ENOBUFS;
                return NULL;