From: Shanmugam S (shanms) Date: Tue, 4 Apr 2023 08:08:02 +0000 (+0000) Subject: Pull request #3794: stream: store thread local flow control pointer in global X-Git-Tag: 3.1.59.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62505095f83c4d180a352abc73c3d37f598a78f0;p=thirdparty%2Fsnort3.git Pull request #3794: stream: store thread local flow control pointer in global Merge in SNORT/snort3 from ~KBHANDAN/snort3:crash_dump_flow_control to master Squashed commit of the following: commit e6dd384b6ba178393dcf1bd56721b7243646a05f Author: Kaushal Bhandankar Date: Tue Apr 4 10:35:32 2023 +0530 stream: store thread local flow control pointer in global --- diff --git a/src/stream/base/stream_base.cc b/src/stream/base/stream_base.cc index a3bf9d99b..15abe460f 100644 --- a/src/stream/base/stream_base.cc +++ b/src/stream/base/stream_base.cc @@ -21,6 +21,7 @@ #endif #include +#include #include "detection/ips_context.h" #include "flow/expect_cache.h" @@ -51,6 +52,9 @@ using namespace snort; THREAD_LOCAL ProfileStats s5PerfStats; THREAD_LOCAL FlowControl* flow_con = nullptr; +std::vector crash_dump_flow_control; +static std::mutex crash_dump_flow_control_mutex; + static BaseStats g_stats; THREAD_LOCAL BaseStats stream_base_stats; THREAD_LOCAL PegCount current_flows_prev; @@ -218,6 +222,11 @@ void StreamBase::tinit() // this is temp added to suppress the compiler error only flow_con = new FlowControl(config.flow_cache_cfg); + + std::unique_lock flow_control_lock(crash_dump_flow_control_mutex); + crash_dump_flow_control.push_back(flow_con); + flow_control_lock.unlock(); + InspectSsnFunc f; StreamHAManager::tinit();