From fad689eeba861f080596e305f2b3e5d0bfaa046d Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 22 Jan 2024 18:06:41 -0800 Subject: [PATCH] tls: set flag whenever app session is freed Type: fix Signed-off-by: Florin Coras Change-Id: I3d44ff851da00573343e15712284af3b9c3912e3 --- src/vnet/tls/tls.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c index 6882f806231a..7c84f15e9e09 100644 --- a/src/vnet/tls/tls.c +++ b/src/vnet/tls/tls.c @@ -216,6 +216,7 @@ tls_notify_app_accept (tls_ctx_t * ctx) { TLS_DBG (1, "failed to allocate fifos"); session_free (app_session); + ctx->no_app_session = 1; return rv; } ctx->app_session_handle = session_handle (app_session); @@ -455,12 +456,15 @@ tls_session_reset_callback (session_t * s) tls_disconnect_transport (ctx); } else - if ((app_session = - session_get_if_valid (ctx->c_s_index, ctx->c_thread_index))) { - session_free (app_session); - ctx->c_s_index = SESSION_INVALID_INDEX; - tls_disconnect_transport (ctx); + app_session = session_get_if_valid (ctx->c_s_index, ctx->c_thread_index); + if (app_session) + { + session_free (app_session); + ctx->c_s_index = SESSION_INVALID_INDEX; + ctx->no_app_session = 1; + tls_disconnect_transport (ctx); + } } }