diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2018-06-12 08:07:07 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2018-06-23 10:07:15 -0400 |
commit | 7e6526404adedf079279aa7aa11722deaca8fe2e (patch) | |
tree | 64a7db3916d2f5bf24dfd17f495f27eb9cc1beca /net/key | |
parent | d159ce7957eec306eacda672e5909e26675ca8ef (diff) |
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 <steffen.klassert@secunet.com>
Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
Acked-by: Benedict Wong <benedictwong@google.com>
Tested-by: Benedict Wong <benedictwong@google.com>
Tested-by: Antony Antony <antony@phenome.org>
Reviewed-by: Eyal Birger <eyal.birger@gmail.com>
Diffstat (limited to 'net/key')
-rw-r--r-- | net/key/af_key.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c index 8bdc1cbe490a..398ebcd614a0 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -1383,7 +1383,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
1383 | } | 1383 | } |
1384 | 1384 | ||
1385 | if (!x) | 1385 | if (!x) |
1386 | x = xfrm_find_acq(net, &dummy_mark, mode, reqid, proto, xdaddr, xsaddr, 1, family); | 1386 | x = xfrm_find_acq(net, &dummy_mark, mode, reqid, 0, proto, xdaddr, xsaddr, 1, family); |
1387 | 1387 | ||
1388 | if (x == NULL) | 1388 | if (x == NULL) |
1389 | return -ENOENT; | 1389 | return -ENOENT; |
@@ -2414,7 +2414,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa | |||
2414 | return err; | 2414 | return err; |
2415 | } | 2415 | } |
2416 | 2416 | ||
2417 | xp = xfrm_policy_bysel_ctx(net, DUMMY_MARK, XFRM_POLICY_TYPE_MAIN, | 2417 | xp = xfrm_policy_bysel_ctx(net, DUMMY_MARK, 0, XFRM_POLICY_TYPE_MAIN, |
2418 | pol->sadb_x_policy_dir - 1, &sel, pol_ctx, | 2418 | pol->sadb_x_policy_dir - 1, &sel, pol_ctx, |
2419 | 1, &err); | 2419 | 1, &err); |
2420 | security_xfrm_policy_free(pol_ctx); | 2420 | security_xfrm_policy_free(pol_ctx); |
@@ -2663,7 +2663,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, const struct sadb_ | |||
2663 | return -EINVAL; | 2663 | return -EINVAL; |
2664 | 2664 | ||
2665 | delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2); | 2665 | delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2); |
2666 | xp = xfrm_policy_byid(net, DUMMY_MARK, XFRM_POLICY_TYPE_MAIN, | 2666 | xp = xfrm_policy_byid(net, DUMMY_MARK, 0, XFRM_POLICY_TYPE_MAIN, |
2667 | dir, pol->sadb_x_policy_id, delete, &err); | 2667 | dir, pol->sadb_x_policy_id, delete, &err); |
2668 | if (xp == NULL) | 2668 | if (xp == NULL) |
2669 | return -ENOENT; | 2669 | return -ENOENT; |