summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-10-06 19:06:35 -0700
committerDave Wallace <dwallacelf@gmail.com>2023-10-09 21:40:38 +0000
commit05919da49d885d757774dbc3fe9b78985cfd9742 (patch)
tree3bcc165a6d5cd6e6838f84acdc749b24199115ee
parentb53daca83f6a4dda015f07a766cdae8707570010 (diff)
tls: report error if connected cannot be initialized
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I987ac6b461b473836917bce6ce0d4ac109cc8ddb (cherry picked from commit a3d55df1e91a7df4ad4c0e1b639ba12a1ed04c79)
-rw-r--r--src/vnet/tls/tls.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 159ed857339..b7ef7de6bd9 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -227,7 +227,12 @@ tls_notify_app_connected (tls_ctx_t * ctx, session_error_t err)
app_session->opaque = ctx->parent_app_api_context;
if ((err = app_worker_init_connected (app_wrk, app_session)))
- goto failed;
+ {
+ app_worker_connect_notify (app_wrk, 0, err, ctx->parent_app_api_context);
+ ctx->no_app_session = 1;
+ session_free (app_session);
+ return -1;
+ }
app_session->session_state = SESSION_STATE_READY;
parent_app_api_ctx = ctx->parent_app_api_context;
@@ -244,9 +249,6 @@ tls_notify_app_connected (tls_ctx_t * ctx, session_error_t err)
return 0;
-failed:
- ctx->no_app_session = 1;
- tls_disconnect (ctx->tls_ctx_handle, vlib_get_thread_index ());
send_reply:
return app_worker_connect_notify (app_wrk, 0, err,
ctx->parent_app_api_context);