From 3159d1c2107698b2bdc17dc889088058540f9e10 Mon Sep 17 00:00:00 2001 From: Gabriel Oginski Date: Fri, 18 Feb 2022 08:05:00 +0000 Subject: ipsec: fix vector after remove entry in spd Originally after remove the policy entry in spd, macro "vec_del1" can change localization of the last entry in vector and finally the entry list has not been sorted. This patch fixes this issue by change executed macro "vec_delete" instead of "vec_del1". Type: fix Signed-off-by: Gabriel Oginski Change-Id: I396591cbbe17646e1d243aedb4cdc272ed4d5e25 (cherry picked from commit aacd3ed6d5c9c32b646795583a634ca5925603d2) --- src/vnet/ipsec/ipsec_spd_policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vnet/ipsec/ipsec_spd_policy.c b/src/vnet/ipsec/ipsec_spd_policy.c index 85acf7aea7b..36405bd6d9b 100644 --- a/src/vnet/ipsec/ipsec_spd_policy.c +++ b/src/vnet/ipsec/ipsec_spd_policy.c @@ -217,7 +217,7 @@ ipsec_add_del_policy (vlib_main_t * vm, spd->policies[policy->type][ii]); if (ipsec_policy_is_equal (vp, policy)) { - vec_del1 (spd->policies[policy->type], ii); + vec_delete (spd->policies[policy->type], 1, ii); ipsec_sa_unlock (vp->sa_index); pool_put (im->policies, vp); break; -- cgit 1.2.3-korg