http: use safe pool realloc 99/35899/13
authorFlorin Coras <fcoras@cisco.com>
Tue, 5 Apr 2022 23:35:39 +0000 (16:35 -0700)
committerDave Barach <openvpp@barachs.net>
Fri, 11 Nov 2022 18:01:31 +0000 (18:01 +0000)
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I572017433a1ba0f8576522f02138928e303e10ab

src/plugins/http/http.c

index 752ca47..048b403 100644 (file)
@@ -59,7 +59,8 @@ http_conn_alloc_w_thread (u32 thread_index)
   http_worker_t *wrk = http_worker_get (thread_index);
   http_conn_t *hc;
 
-  pool_get_zero (wrk->conn_pool, hc);
+  pool_get_aligned_safe (wrk->conn_pool, hc, CLIB_CACHE_LINE_BYTES);
+  clib_memset (hc, 0, sizeof (*hc));
   hc->c_thread_index = thread_index;
   hc->h_hc_index = hc - wrk->conn_pool;
   hc->h_pa_session_handle = SESSION_INVALID_HANDLE;