From f8c9390ca368ba8f48d1f1f47c7a37383112d193 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Thu, 8 Jun 2023 10:25:30 -0400 Subject: [PATCH] stream/cache: Return sessions to correct pool Issue: 5563 This commit fixes the release of TCP resources. The sessions were being returned to the segment thread pool instead of the sessions pool. --- src/stream-tcp-cache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stream-tcp-cache.c b/src/stream-tcp-cache.c index c5a9e30e47..f6a7c12b33 100644 --- a/src/stream-tcp-cache.c +++ b/src/stream-tcp-cache.c @@ -157,19 +157,19 @@ void StreamTcpThreadCacheCleanup(void) /* sessions */ SCLogDebug("tcp_pool_cache.ssns_cache_idx %u", tcp_pool_cache.ssns_cache_idx); for (uint32_t i = 0; i < tcp_pool_cache.ssns_cache_idx; i++) { - PoolThreadReturn(segment_thread_pool, tcp_pool_cache.ssns_cache[i]); + PoolThreadReturn(ssn_pool, tcp_pool_cache.ssns_cache[i]); } tcp_pool_cache.ssns_cache_idx = 0; SCLogDebug("tcp_pool_cache.ssns_returns_idx %u", tcp_pool_cache.ssns_returns_idx); if (tcp_pool_cache.ssns_returns_idx) { PoolThreadId pool_id = tcp_pool_cache.ssns_returns[0]->pool_id; - PoolThreadLock(segment_thread_pool, pool_id); + PoolThreadLock(ssn_pool, pool_id); for (uint32_t i = 0; i < tcp_pool_cache.ssns_returns_idx; i++) { TcpSession *ret_ssn = tcp_pool_cache.ssns_returns[i]; - PoolThreadReturnRaw(segment_thread_pool, pool_id, ret_ssn); + PoolThreadReturnRaw(ssn_pool, pool_id, ret_ssn); } - PoolThreadUnlock(segment_thread_pool, pool_id); + PoolThreadUnlock(ssn_pool, pool_id); tcp_pool_cache.ssns_returns_idx = 0; } -- 2.47.2