summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-03-26 08:26:39 +0000
committerNeale Ranns <nranns@cisco.com>2019-03-26 08:26:39 +0000
commit50d5069a80fd763f4270d61d991febbdfa88aed3 (patch)
tree88275cfcf1da9d2953d1a01e60055f5b85757a2f /src
parent03dd90adfe652894e4a70c6360e0618caae11145 (diff)
IPSEC: improved policy delete
Change-Id: Icdf51b094c34725c079d2e4acbb955744434302d Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/ipsec/ipsec_spd_policy.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/vnet/ipsec/ipsec_spd_policy.c b/src/vnet/ipsec/ipsec_spd_policy.c
index d4a32e38568..8528c8eafa3 100644
--- a/src/vnet/ipsec/ipsec_spd_policy.c
+++ b/src/vnet/ipsec/ipsec_spd_policy.c
@@ -182,23 +182,19 @@ ipsec_add_del_policy (vlib_main_t * vm,
}
else
{
- ipsec_spd_policy_type_t ptype;
u32 ii;
- FOR_EACH_IPSEC_SPD_POLICY_TYPE (ptype)
+ vec_foreach_index (ii, (spd->policies[policy->type]))
{
- vec_foreach_index (ii, (spd->policies[ptype]))
- {
- vp = pool_elt_at_index (im->policies, spd->policies[ptype][ii]);
- if (ipsec_policy_is_equal (vp, policy))
- {
- vec_del1 (spd->policies[ptype], ii);
- pool_put (im->policies, vp);
- goto done;
- }
- }
+ vp = pool_elt_at_index (im->policies,
+ spd->policies[policy->type][ii]);
+ if (ipsec_policy_is_equal (vp, policy))
+ {
+ vec_del1 (spd->policies[policy->type], ii);
+ pool_put (im->policies, vp);
+ break;
+ }
}
- done:;
}
return 0;