tls: allow disconnects from main thread

Type: fix

Use api with explicit thread index to retrieve tls contex on close.

Change-Id: Ibdc4338747300b7fc8f91ef3e10bcd48ce7ae366
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 6faac1622e0d5352da987c73a6f3f1ec55896116)
This commit is contained in:
Florin Coras 2019-10-11 08:00:43 -07:00 committed by Andrew Yourtchenko
parent cdb11ea329
commit e68fe9c516

View File

@ -386,7 +386,10 @@ tls_session_disconnect_callback (session_t * tls_session)
TLS_DBG (1, "TCP disconnecting handle %x session %u", tls_session->opaque,
tls_session->session_index);
ctx = tls_ctx_get (tls_session->opaque);
ASSERT (tls_session->thread_index == vlib_get_thread_index ()
|| vlib_thread_is_main_w_barrier ());
ctx = tls_ctx_get_w_thread (tls_session->opaque, tls_session->thread_index);
ctx->is_passive_close = 1;
tls_ctx_transport_close (ctx);
}