tls: fix transport endpoint get 70/40370/3
authorFlorin Coras <fcoras@cisco.com>
Tue, 20 Feb 2024 19:24:54 +0000 (11:24 -0800)
committerFlorin Coras <fcoras@cisco.com>
Tue, 20 Feb 2024 19:27:03 +0000 (11:27 -0800)
Type: fix

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

src/vnet/tls/tls.c

index 9694b27..1e7194c 100644 (file)
@@ -1167,10 +1167,11 @@ tls_transport_endpoint_get (u32 ctx_handle, u32 thread_index,
                            transport_endpoint_t * tep, u8 is_lcl)
 {
   tls_ctx_t *ctx = tls_ctx_get_w_thread (ctx_handle, thread_index);
-  session_t *tcp_session;
+  session_t *ts;
 
-  tcp_session = session_get_from_handle (ctx->tls_session_handle);
-  session_get_endpoint (tcp_session, tep, is_lcl);
+  ts = session_get_from_handle (ctx->tls_session_handle);
+  if (ts && ts->session_state < SESSION_STATE_TRANSPORT_DELETED)
+    session_get_endpoint (ts, tep, is_lcl);
 }
 
 static void