UPSTREAM: xfrm: Add a new lookup key to match xfrm interfaces.
authorSteffen Klassert <steffen.klassert@secunet.com>
Tue, 12 Jun 2018 12:07:07 +0000 (14:07 +0200)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:37:05 +0000 (17:37 +0800)
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>
(cherry picked from commit 7e6526404adedf079279aa7aa11722deaca8fe2e)
Signed-off-by: Benedict Wong <benedictwong@google.com>
Bug: 113046120
Change-Id: I27d7757a374b0bd5f97c3e723773d6c7470a0717

net/xfrm/xfrm_state.c

index 7fbe478f83ca4adc6ffca52eb23610feca0a4c32..ebdbce2703ce511f4d37287675b1287233fd65a0 100644 (file)
@@ -941,6 +941,7 @@ xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
        int error = 0;
        struct xfrm_state *best = NULL;
        u32 mark = pol->mark.v & pol->mark.m;
+       u32 if_id = fl->flowi_xfrm.if_id;
        unsigned short encap_family = tmpl->encap_family;
        unsigned int sequence;
        struct km_event c;