tls: set flag whenever app session is freed 34/40234/3
authorFlorin Coras <fcoras@cisco.com>
Tue, 23 Jan 2024 02:06:41 +0000 (18:06 -0800)
committerDave Barach <vpp@barachs.net>
Tue, 23 Jan 2024 16:32:08 +0000 (16:32 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3d44ff851da00573343e15712284af3b9c3912e3

src/vnet/tls/tls.c

index 6882f80..7c84f15 100644 (file)
@@ -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);
+       }
     }
 }