From: Yurii Chalov -X (ychalov - SOFTSERVE INC at Cisco) Date: Tue, 21 May 2024 13:28:52 +0000 (+0000) Subject: Pull request #4308: main: apply loaded configuration only once X-Git-Tag: 3.2.2.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=342b8e6f246de1d6dcf8831738e9dbd0aa025a44;p=thirdparty%2Fsnort3.git Pull request #4308: main: apply loaded configuration only once Merge in SNORT/snort3 from ~YCHALOV/snort3:reload_config_fix to master Squashed commit of the following: commit 48cb1070b58345b33c2bdca7c3c20ea38164ad3e Author: Yurii Chalov Date: Wed Apr 24 23:17:02 2024 +0200 main: apply loaded configuration only once --- diff --git a/src/main/swapper.cc b/src/main/swapper.cc index d60a42c00..4f4b51545 100644 --- a/src/main/swapper.cc +++ b/src/main/swapper.cc @@ -63,7 +63,8 @@ void Swapper::apply(Analyzer& analyzer) { if ( new_conf ) { - const bool reload = (SnortConfig::get_conf() != nullptr); + const auto cur_conf = SnortConfig::get_conf(); + const bool reload = cur_conf and cur_conf != new_conf; SnortConfig::set_conf(new_conf); // FIXIT-M Determine whether we really want to do this before or after the set_conf if ( reload )