mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
xfrm: Add a new lookup key to match xfrm interfaces.
This patch adds the xfrm interface id as a lookup key for xfrm states and policies. With this we can assign states and policies to virtual xfrm interfaces. Signed-off-by: Steffen Klassert <[email protected]> Acked-by: Shannon Nelson <[email protected]> Acked-by: Benedict Wong <[email protected]> Tested-by: Benedict Wong <[email protected]> Tested-by: Antony Antony <[email protected]> Reviewed-by: Eyal Birger <[email protected]>
This commit is contained in:
parent
d159ce7957
commit
7e6526404a
7 changed files with 96 additions and 25 deletions
|
|
@ -1383,7 +1383,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_
|
|||
}
|
||||
|
||||
if (!x)
|
||||
x = xfrm_find_acq(net, &dummy_mark, mode, reqid, proto, xdaddr, xsaddr, 1, family);
|
||||
x = xfrm_find_acq(net, &dummy_mark, mode, reqid, 0, proto, xdaddr, xsaddr, 1, family);
|
||||
|
||||
if (x == NULL)
|
||||
return -ENOENT;
|
||||
|
|
@ -2414,7 +2414,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa
|
|||
return err;
|
||||
}
|
||||
|
||||
xp = xfrm_policy_bysel_ctx(net, DUMMY_MARK, XFRM_POLICY_TYPE_MAIN,
|
||||
xp = xfrm_policy_bysel_ctx(net, DUMMY_MARK, 0, XFRM_POLICY_TYPE_MAIN,
|
||||
pol->sadb_x_policy_dir - 1, &sel, pol_ctx,
|
||||
1, &err);
|
||||
security_xfrm_policy_free(pol_ctx);
|
||||
|
|
@ -2663,7 +2663,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, const struct sadb_
|
|||
return -EINVAL;
|
||||
|
||||
delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2);
|
||||
xp = xfrm_policy_byid(net, DUMMY_MARK, XFRM_POLICY_TYPE_MAIN,
|
||||
xp = xfrm_policy_byid(net, DUMMY_MARK, 0, XFRM_POLICY_TYPE_MAIN,
|
||||
dir, pol->sadb_x_policy_id, delete, &err);
|
||||
if (xp == NULL)
|
||||
return -ENOENT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue