netns xfrm: finding policy in netns
[safe/jmp/linux-2.6] / net / key / af_key.c
index 0f44856..ca26811 100644 (file)
@@ -2324,7 +2324,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, struct sadb_msg
                        return err;
        }
 
-       xp = xfrm_policy_bysel_ctx(XFRM_POLICY_TYPE_MAIN,
+       xp = xfrm_policy_bysel_ctx(&init_net, XFRM_POLICY_TYPE_MAIN,
                                   pol->sadb_x_policy_dir - 1, &sel, pol_ctx,
                                   1, &err);
        security_xfrm_policy_free(pol_ctx);
@@ -2571,8 +2571,8 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
                return -EINVAL;
 
        delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2);
-       xp = xfrm_policy_byid(XFRM_POLICY_TYPE_MAIN, dir, pol->sadb_x_policy_id,
-                             delete, &err);
+       xp = xfrm_policy_byid(&init_net, XFRM_POLICY_TYPE_MAIN, dir,
+                             pol->sadb_x_policy_id, delete, &err);
        if (xp == NULL)
                return -ENOENT;