summaryrefslogtreecommitdiffstats
path: root/src/vnet/tls/tls.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-09-07 09:13:15 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-09-07 21:30:44 +0000
commit74cac8839efae6a69baea031fb01602ef8907e8a (patch)
treec94cc43b74ef84f500664821df3338e4b7668e49 /src/vnet/tls/tls.c
parentd790c7e1fa5f1accb621aa75089212be586c137f (diff)
session: fix reentrant listens
Change-Id: I72d400401a308012b43513179870823f6f921e44 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tls/tls.c')
-rw-r--r--src/vnet/tls/tls.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index ae426fba594..2d7126a6dfe 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -522,6 +522,7 @@ tls_disconnect (u32 ctx_handle, u32 thread_index)
u32
tls_start_listen (u32 app_listener_index, transport_endpoint_t * tep)
{
+ vnet_bind_args_t _bargs, *args = &_bargs;
app_worker_t *app_wrk;
tls_main_t *tm = &tls_main;
session_handle_t tls_handle;
@@ -529,7 +530,7 @@ tls_start_listen (u32 app_listener_index, transport_endpoint_t * tep)
stream_session_t *tls_listener;
stream_session_t *app_listener;
tls_engine_type_t engine_type;
- application_t *app, *tls_app;
+ application_t *app;
tls_ctx_t *lctx;
u32 lctx_index;
@@ -543,15 +544,15 @@ tls_start_listen (u32 app_listener_index, transport_endpoint_t * tep)
return -1;
}
- lctx_index = tls_listener_ctx_alloc ();
-
- /* TODO hide this by calling vnet_bind() */
- tls_app = application_get (tm->app_index);
-// tls_app_wrk = application_get_default_worker (tls_app);
sep->transport_proto = TRANSPORT_PROTO_TCP;
- if (application_start_listen (tls_app, sep, &tls_handle))
- return ~0;
+ memset (args, 0, sizeof (*args));
+ args->app_index = tm->app_index;
+ args->sep_ext = *sep;
+ if (vnet_bind (args))
+ return -1;
+ tls_handle = args->handle;
+ lctx_index = tls_listener_ctx_alloc ();
tls_listener = listen_session_get_from_handle (tls_handle);
tls_listener->opaque = lctx_index;