diff options
| author | Antony Antony <antony.antony@secunet.com> | 2026-10-07 11:35:09 +0200 |
|---|---|---|
| committer | Steffen Klassert <steffen.klassert@secunet.com> | 2026-10-19 08:02:05 +0200 |
| commit | 6362f459bfc485d805f0439ae4566c1b014abfa4 (patch) | |
| tree | 7b2819e682d8803ac0e37d4e64aa8d502b47a91b /include/net | |
| parent | b3056e57b0657a4401349187c620d0fa1b8914c8 (diff) | |
| download | linux-next-6362f459bfc485d805f0439ae4566c1b014abfa4.tar.gz linux-next-6362f459bfc485d805f0439ae4566c1b014abfa4.zip | |
xfrm: state: exact mark/mask match for SPI-keyed control-plane SA lookups
Add __xfrm_state_lookup_exact(); wire it into DELSA/GETSA, GETAE/NEWAE,
EXPIRE, MIGRATE_STATE. xfrm_state_update() (UPDSA) keeps wildcard match
because ALLOCSPI's larval state may be unmarked (mark 0/0), so an
exact-match UPDSA would not find it and the ADD fallback would then
fail with -EEXIST via xfrm_state_add().
Fixes: 3d6acfa7641f ("xfrm: SA lookups with mark")
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/xfrm.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index a6d69aaa6cd2..9e053388aa4b 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -1748,6 +1748,9 @@ struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark, const xfrm_address_t *saddr, u8 proto, unsigned short family); +struct xfrm_state *xfrm_state_lookup_exact(struct net *net, const struct xfrm_mark *mark, + const xfrm_address_t *daddr, __be32 spi, + u8 proto, unsigned short family); #ifdef CONFIG_XFRM_SUB_POLICY void xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, unsigned short family); |
