aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec
diff options
context:
space:
mode:
authorGabriel Oginski <gabrielx.oginski@intel.com>2022-02-18 08:05:00 +0000
committerGabriel Oginski <gabrielx.oginski@intel.com>2022-02-18 09:15:10 +0100
commitaacd3ed6d5c9c32b646795583a634ca5925603d2 (patch)
treede19fc5294b3597a4ff5149b47f63d8e458b9958 /src/vnet/ipsec
parent2273ffd8787a7ca11f4a2ccbb4dadd39b1a17026 (diff)
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 <gabrielx.oginski@intel.com> Change-Id: I396591cbbe17646e1d243aedb4cdc272ed4d5e25
Diffstat (limited to 'src/vnet/ipsec')
-rw-r--r--src/vnet/ipsec/ipsec_spd_policy.c2
1 files changed, 1 insertions, 1 deletions
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;