aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2020-10-01 03:08:52 +0000
committerDave Wallace <dwallacelf@gmail.com>2020-10-14 16:08:59 +0000
commit4a232f88d041b807ed8d3ad807a40809e86861eb (patch)
treee31f0785ede7dcee3714a6d0fc5eb4b846cd7364 /src
parent94f5335efba1f396a2a96ecb3b7ac0636a01177b (diff)
ikev2: fix leaking pending INIT requests
.. when associated profile is deleted. Type: fix Change-Id: Ib05831d79b3b58664ee0a930960513fd465373bf Signed-off-by: Filip Tehlar <ftehlar@cisco.com> (cherry picked from commit 6614df53509030f1c3faf52512bcd8a9851dec5c)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/ikev2/ikev2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/ikev2/ikev2.c b/src/plugins/ikev2/ikev2.c
index bfad2adbd9e..7632a567fd4 100644
--- a/src/plugins/ikev2/ikev2.c
+++ b/src/plugins/ikev2/ikev2.c
@@ -3334,6 +3334,22 @@ ikev2_cleanup_profile_sessions (ikev2_main_t * km, ikev2_profile_t * p)
u32 *sai;
u32 *del_sai = 0;
+ /* *INDENT-OFF* */
+ pool_foreach(sa, km->sais, ({
+ if (pi == sa->profile_index)
+ vec_add1 (del_sai, sa - km->sais);
+ }));
+ /* *INDENT-ON* */
+
+ vec_foreach (sai, del_sai)
+ {
+ sa = pool_elt_at_index (km->sais, sai[0]);
+ ikev2_sa_free_all_vec (sa);
+ hash_unset (km->sa_by_ispi, sa->ispi);
+ pool_put (km->sais, sa);
+ }
+ vec_reset_length (del_sai);
+
vec_foreach (tkm, km->per_thread_data)
{
/* *INDENT-OFF* */