summaryrefslogtreecommitdiffstats
path: root/src/plugins/srtp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-04-05 15:53:31 -0700
committerDave Barach <openvpp@barachs.net>2022-11-11 18:01:21 +0000
commitec315bf7b4e622b6a6cd059ac7ca7f5495e3c11b (patch)
tree634a78d0d771cef5c8125cd19eba0a652eb4c88c /src/plugins/srtp
parent9688b3bda2a1c27c2e831c36d9e4432d552dfe58 (diff)
srtp: use safe pool reallocs
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I15fea1f90640ea54cafe3ea929e871ec6e86fc67
Diffstat (limited to 'src/plugins/srtp')
-rw-r--r--src/plugins/srtp/srtp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/srtp/srtp.c b/src/plugins/srtp/srtp.c
index c9987e8a47f..36f4628aa0c 100644
--- a/src/plugins/srtp/srtp.c
+++ b/src/plugins/srtp/srtp.c
@@ -26,7 +26,9 @@ static inline u32
srtp_ctx_alloc_w_thread (u32 thread_index)
{
srtp_tc_t *ctx;
- pool_get_zero (srtp_main.ctx_pool[thread_index], ctx);
+ pool_get_aligned_safe (srtp_main.ctx_pool[thread_index], ctx,
+ CLIB_CACHE_LINE_BYTES);
+ clib_memset (ctx, 0, sizeof (*ctx));
ctx->c_thread_index = thread_index;
ctx->srtp_ctx_handle = ctx - srtp_main.ctx_pool[thread_index];
ctx->app_session_handle = SESSION_INVALID_HANDLE;
@@ -84,7 +86,8 @@ srtp_ctx_attach (u32 thread_index, void *ctx_ptr)
{
srtp_tc_t *ctx;
- pool_get (srtp_main.ctx_pool[thread_index], ctx);
+ pool_get_aligned_safe (srtp_main.ctx_pool[thread_index], ctx,
+ CLIB_CACHE_LINE_BYTES);
clib_memcpy (ctx, ctx_ptr, sizeof (*ctx));
ctx->c_thread_index = thread_index;