From 009303dc06f8ecf4ed16c71e18c4e7fd40372eeb Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Tue, 29 Mar 2022 17:49:37 -0700 Subject: tls: use safe pool reallocs Type: improvement Signed-off-by: Florin Coras Change-Id: Ia2c771cbf826526d2d06b6da022509ab02917350 --- src/plugins/tlsopenssl/tls_openssl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/tlsopenssl') diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c index 1e35f9d8e19..5ccc492328a 100644 --- a/src/plugins/tlsopenssl/tls_openssl.c +++ b/src/plugins/tlsopenssl/tls_openssl.c @@ -40,7 +40,8 @@ openssl_ctx_alloc_w_thread (u32 thread_index) openssl_main_t *om = &openssl_main; openssl_ctx_t **ctx; - pool_get (om->ctx_pool[thread_index], ctx); + pool_get_aligned_safe (om->ctx_pool[thread_index], ctx, 0); + if (!(*ctx)) *ctx = clib_mem_alloc (sizeof (openssl_ctx_t)); @@ -99,7 +100,7 @@ openssl_ctx_attach (u32 thread_index, void *ctx_ptr) session_handle_t sh; openssl_ctx_t **oc; - pool_get (om->ctx_pool[thread_index], oc); + pool_get_aligned_safe (om->ctx_pool[thread_index], oc, 0); /* Free the old instance instead of looking for an empty spot */ if (*oc) clib_mem_free (*oc); -- cgit 1.2.3-korg