diff options
author | Florin Coras <fcoras@cisco.com> | 2021-05-28 18:29:08 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2021-05-29 19:51:58 +0000 |
commit | 71ee375f7266b450d6a3d4e28247f4b12016abfb (patch) | |
tree | d685d7199c70cb648d1024cc3aa5a44074a09bd4 | |
parent | 8a6f5d394c69eba3bfaddfe36a93d1013cba3ce3 (diff) |
tls: fix handling of failed connects
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ifbf43dd69aa07be485fe7fa01c917512e423036e
-rw-r--r-- | src/vnet/tls/tls.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c index 1ab885e3db5..21060288db0 100644 --- a/src/vnet/tls/tls.c +++ b/src/vnet/tls/tls.c @@ -539,22 +539,6 @@ tls_session_connected_cb (u32 tls_app_index, u32 ho_ctx_index, ho_ctx = tls_ctx_half_open_get (ho_ctx_index); - if (err) - { - app_worker_t *app_wrk; - u32 api_context; - int rv = 0; - - app_wrk = app_worker_get_if_valid (ho_ctx->parent_app_wrk_index); - if (app_wrk) - { - api_context = ho_ctx->parent_app_api_context; - app_worker_connect_notify (app_wrk, 0, err, api_context); - } - tls_ctx_half_open_reader_unlock (); - return rv; - } - ctx_handle = tls_ctx_alloc (ho_ctx->tls_ctx_engine); ctx = tls_ctx_get (ctx_handle); clib_memcpy_fast (ctx, ho_ctx, sizeof (*ctx)); @@ -607,6 +591,24 @@ int tls_session_connected_callback (u32 tls_app_index, u32 ho_ctx_index, session_t *tls_session, session_error_t err) { + if (err) + { + app_worker_t *app_wrk; + tls_ctx_t *ho_ctx; + u32 api_context; + + ho_ctx = tls_ctx_half_open_get (ho_ctx_index); + app_wrk = app_worker_get_if_valid (ho_ctx->parent_app_wrk_index); + if (app_wrk) + { + api_context = ho_ctx->parent_app_api_context; + app_worker_connect_notify (app_wrk, 0, err, api_context); + } + tls_ctx_half_open_reader_unlock (); + + return 0; + } + if (session_get_transport_proto (tls_session) == TRANSPORT_PROTO_TCP) return tls_session_connected_cb (tls_app_index, ho_ctx_index, tls_session, err); |