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)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:24:00 +0000 (20:24 +0300)
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 6b17725e450c6bb1813476bb08d1df2f742f2222..df10d023731ab0a59350631e60b96def5af3e4ec 100644 (file)
@@ -945,6 +945,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;