From: Jeff Lucovsky Date: Thu, 8 Jun 2023 14:25:30 +0000 (-0400) Subject: stream/cache: Return sessions to correct pool X-Git-Tag: suricata-7.0.0-rc2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8c9390ca368ba8f48d1f1f47c7a37383112d193;p=thirdparty%2Fsuricata.git 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. --- 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; }