summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-11 08:00:43 -0700
committerDave Barach <openvpp@barachs.net>2019-10-12 17:12:49 +0000
commit6faac1622e0d5352da987c73a6f3f1ec55896116 (patch)
tree90ba9458beec94e7d14cddeb646d99fcb27fae12
parent39c93494829159238250a80b26851f4343cc5004 (diff)
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>
-rw-r--r--src/vnet/tls/tls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 304819007d5..28c1f5855ea 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -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);
}