]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
thread modules: separate initialization from registration
authorJason Ish <jason.ish@oisf.net>
Tue, 27 Feb 2024 22:07:33 +0000 (16:07 -0600)
committerVictor Julien <victor@inliniac.net>
Sat, 2 Mar 2024 10:40:18 +0000 (11:40 +0100)
Move the zero'ing to the thread module array InitGlobal in an effort
to fix capture modules.

At some point device validation moved to a point in startup before
plugins are loaded meaning that capture plugins could not be
used. Moving plugin registration early enough caused some of their
registration to be wiped out as clearing the array was done after.

Bug: #6811

src/suricata.c

index 6417379758c5b5d615dd44cee204fe18e19c7339..f727a6ff21e005be1e93d7ac04b74f3138936269 100644 (file)
@@ -879,9 +879,6 @@ int g_ut_covered;
 
 void RegisterAllModules(void)
 {
-    // zero all module storage
-    memset(tmm_modules, 0, TMM_SIZE * sizeof(TmModule));
-
     /* commanders */
     TmModuleUnixManagerRegister();
     /* managers */
@@ -2872,6 +2869,10 @@ int InitGlobal(void)
     ConfInit();
 
     VarNameStoreInit();
+
+    // zero all module storage
+    memset(tmm_modules, 0, TMM_SIZE * sizeof(TmModule));
+
     return 0;
 }