summaryrefslogtreecommitdiffstats
path: root/src/vnet/tls/tls.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-23 22:38:16 -0700
committerDamjan Marion <dmarion@me.com>2019-07-24 10:59:40 +0000
commitae3eaacaf1df7b83d6ef6b30290e1390d38197df (patch)
tree4e80c067f992c1020100c71e376a3b01059f5501 /src/vnet/tls/tls.c
parent994ef1c1643d89eebc4f5fa8ba1e97e3e3a7ab2a (diff)
tls: handle engine listen failure
Type:fix Change-Id: I528b7cfcb7a6aada94ee3649378e6fbe84d2e4e6 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tls/tls.c')
-rw-r--r--src/vnet/tls/tls.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 6769fd254b6..4a9ec4e7eb6 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -602,7 +602,18 @@ tls_start_listen (u32 app_listener_index, transport_endpoint_t * tep)
lctx->tcp_is_ip4 = sep->is_ip4;
lctx->tls_ctx_engine = engine_type;
- tls_vfts[engine_type].ctx_start_listen (lctx);
+ if (tls_vfts[engine_type].ctx_start_listen (lctx))
+ {
+ vnet_unlisten_args_t a = {
+ .handle = lctx->tls_session_handle,
+ .app_index = tls_main.app_index,
+ .wrk_map_index = 0
+ };
+ if ((vnet_unlisten (&a)))
+ clib_warning ("unlisten returned");
+ tls_listener_ctx_free (lctx);
+ lctx_index = SESSION_INVALID_INDEX;
+ }
TLS_DBG (1, "Started listening %d, engine type %d", lctx_index,
engine_type);