X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ftls%2Ftls.c;h=9a82360610b8b0ddce7351af2992e7c048a3fb3a;hb=eb97e5f548b009ffa92efa3f778b4a7f6f40b7eb;hp=aba7919927c00f2b4dadbb4c0796c1eba3ed1c8a;hpb=f47e9b648aaab716c62bf004fa36176dbe8b21d7;p=vpp.git diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c index aba7919927c..9a82360610b 100644 --- a/src/vnet/tls/tls.c +++ b/src/vnet/tls/tls.c @@ -119,6 +119,7 @@ tls_ctx_half_open_alloc (void) { clib_rwlock_writer_lock (&tm->half_open_rwlock); pool_get (tm->half_open_ctx_pool, ctx); + ctx_index = ctx - tm->half_open_ctx_pool; clib_rwlock_writer_unlock (&tm->half_open_rwlock); } else @@ -126,10 +127,10 @@ tls_ctx_half_open_alloc (void) /* reader lock assumption: only main thread will call pool_get */ clib_rwlock_reader_lock (&tm->half_open_rwlock); pool_get (tm->half_open_ctx_pool, ctx); + ctx_index = ctx - tm->half_open_ctx_pool; clib_rwlock_reader_unlock (&tm->half_open_rwlock); } memset (ctx, 0, sizeof (*ctx)); - ctx_index = ctx - tm->half_open_ctx_pool; return ctx_index; } @@ -254,6 +255,8 @@ tls_notify_app_connected (tls_ctx_t * ctx, u8 is_failed) { TLS_DBG (1, "failed to notify app"); tls_disconnect (ctx->tls_ctx_handle, vlib_get_thread_index ()); + session_free_w_fifos (app_session); + return -1; } session_lookup_add_connection (&ctx->connection,