]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2537 in SNORT/snort3 from ~SMINUT/snort3:get_tcp_fp_fix to master
authorRon Dempster (rdempste) <rdempste@cisco.com>
Tue, 13 Oct 2020 17:25:10 +0000 (17:25 +0000)
committerRon Dempster (rdempste) <rdempste@cisco.com>
Tue, 13 Oct 2020 17:25:10 +0000 (17:25 +0000)
Squashed commit of the following:

commit b8177da6c546efe84744390069c38246f2b9cdb2
Author: Silviu Minut <sminut@cisco.com>
Date:   Tue Oct 13 08:28:00 2020 -0400

    rna: condition reload tuner registration on get_inspector()

commit 392001e0d190628e0af4eda1eaa6c1c3cb857208
Author: Silviu Minut <sminut@cisco.com>
Date:   Fri Oct 9 22:53:25 2020 -0400

    rna: move registration of reload tuner to configure()

src/network_inspectors/rna/rna_inspector.cc
src/network_inspectors/rna/rna_module.cc
src/network_inspectors/rna/test/rna_module_test.cc

index a2213952e6867c123e64d020acf7bb19c1763681..b23d7fef67c67378b9deb01d78835d9505899199 100644 (file)
@@ -30,6 +30,7 @@
 #include <string>
 
 #include "log/messages.h"
+#include "main/snort.h"
 #include "managers/inspector_manager.h"
 #include "protocols/packet.h"
 
@@ -94,6 +95,10 @@ bool RnaInspector::configure(SnortConfig* sc)
     if (rna_conf && rna_conf->log_when_idle)
         DataBus::subscribe_global( THREAD_IDLE_EVENT, new RnaIdleEventHandler(*pnd), sc );
 
+    // tinit is not called during reload, so pass processor pointers to threads via reload tuner
+    if ( Snort::is_reloading() && InspectorManager::get_inspector(RNA_NAME, true) )
+        sc->register_reload_resource_tuner(new FpProcReloadTuner(*mod_conf));
+
     return true;
 }
 
index 6a9e7ef9b23e52c6b9bfaa6dc489d48d2d5b9bf2..4ff3cbb885431d9739a4ed8dc2f49612f92bbbb9 100644 (file)
@@ -33,7 +33,6 @@
 #include "log/messages.h"
 #include "lua/lua.h"
 #include "main/snort_config.h"
-#include "main/snort.h"
 #include "managers/module_manager.h"
 #include "utils/util.h"
 
@@ -310,9 +309,6 @@ bool RnaModule::end(const char* fqn, int index, SnortConfig* sc)
 
         if ( mod_conf->ua_processor )
             mod_conf->ua_processor->make_mpse(sc);
-
-        if ( (mod_conf->tcp_processor || mod_conf->ua_processor) && Snort::is_reloading() )
-            sc->register_reload_resource_tuner(new FpProcReloadTuner(*mod_conf));
     }
 
     if ( index > 0 and mod_conf->tcp_processor and !strcmp(fqn, "rna.tcp_fingerprints") )
index e0d653d613063fe953d8ce59143ce31df142a1e4..586adbca2d8634fc8a80e3af102140aa4ad4aa34 100644 (file)
@@ -41,7 +41,6 @@ void set_ua_fp_processor(UaFpProcessor*) { }
 
 namespace snort
 {
-    bool Snort::is_reloading() { return false; }
     void SnortConfig::register_reload_resource_tuner(ReloadResourceTuner* rrt) { delete rrt; }
 }