]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4308: main: apply loaded configuration only once
authorYurii Chalov -X (ychalov - SOFTSERVE INC at Cisco) <ychalov@cisco.com>
Tue, 21 May 2024 13:28:52 +0000 (13:28 +0000)
committerOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Tue, 21 May 2024 13:28:52 +0000 (13:28 +0000)
Merge in SNORT/snort3 from ~YCHALOV/snort3:reload_config_fix to master

Squashed commit of the following:

commit 48cb1070b58345b33c2bdca7c3c20ea38164ad3e
Author: Yurii Chalov <ychalov@cisco.com>
Date:   Wed Apr 24 23:17:02 2024 +0200

    main: apply loaded configuration only once

src/main/swapper.cc

index d60a42c00c992ba30f230ad3d3b0ffd4ab069e33..4f4b515452a7ac98282c5226ef848d08e607d3e3 100644 (file)
@@ -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 )