From: Jason Ish Date: Tue, 27 Feb 2024 22:07:33 +0000 (-0600) Subject: thread modules: separate initialization from registration X-Git-Tag: suricata-8.0.0-beta1~1694 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96e61b043c9b6757ca84ddb74543073b2ef3d7e6;p=thirdparty%2Fsuricata.git thread modules: separate initialization from registration 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 --- diff --git a/src/suricata.c b/src/suricata.c index 6417379758..f727a6ff21 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -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; }