From 96e61b043c9b6757ca84ddb74543073b2ef3d7e6 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Tue, 27 Feb 2024 16:07:33 -0600 Subject: [PATCH] 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 --- src/suricata.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; } -- 2.47.2