]> 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>
Mon, 11 Mar 2024 16:10:26 +0000 (17:10 +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
(cherry picked from commit 96e61b043c9b6757ca84ddb74543073b2ef3d7e6)

src/suricata.c

index 82d18b930722ed6bfed27776faa4bf324d13019a..13afdbcfe9450b10176913de346859afb7a7ba21 100644 (file)
@@ -881,9 +881,6 @@ int g_ut_covered;
 
 void RegisterAllModules(void)
 {
-    // zero all module storage
-    memset(tmm_modules, 0, TMM_SIZE * sizeof(TmModule));
-
     /* commanders */
     TmModuleUnixManagerRegister();
     /* managers */
@@ -2869,6 +2866,10 @@ int InitGlobal(void)
     ConfInit();
 
     VarNameStoreInit();
+
+    // zero all module storage
+    memset(tmm_modules, 0, TMM_SIZE * sizeof(TmModule));
+
     return 0;
 }