From: Jason Ish Date: Mon, 26 Aug 2024 21:37:42 +0000 (-0600) Subject: output-flow: remove unused initdata argument X-Git-Tag: suricata-8.0.0-beta1~931 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afcf591719070ce3259478add2cb8cbbe29a3702;p=thirdparty%2Fsuricata.git output-flow: remove unused initdata argument The initdata argument to OutputFlowThreadInit was always NULL, remove it. Internally the ThreadInit functions still get initdata, but this is the data provided when that logging instance was registered. Ticket: #7227 --- diff --git a/src/decode.c b/src/decode.c index 927791b08b..0ed546def2 100644 --- a/src/decode.c +++ b/src/decode.c @@ -779,7 +779,7 @@ DecodeThreadVars *DecodeThreadVarsAlloc(ThreadVars *tv) dtv->app_tctx = AppLayerGetCtxThread(); - if (OutputFlowLogThreadInit(tv, NULL, &dtv->output_flow_thread_data) != TM_ECODE_OK) { + if (OutputFlowLogThreadInit(tv, &dtv->output_flow_thread_data) != TM_ECODE_OK) { SCLogError("initializing flow log API for thread failed"); DecodeThreadVarsFree(tv, dtv); return NULL; diff --git a/src/flow-manager.c b/src/flow-manager.c index bc688ed43f..15abaa40b2 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -1021,7 +1021,7 @@ static TmEcode FlowRecyclerThreadInit(ThreadVars *t, const void *initdata, void FlowRecyclerThreadData *ftd = SCCalloc(1, sizeof(FlowRecyclerThreadData)); if (ftd == NULL) return TM_ECODE_FAILED; - if (OutputFlowLogThreadInit(t, NULL, &ftd->output_thread_data) != TM_ECODE_OK) { + if (OutputFlowLogThreadInit(t, &ftd->output_thread_data) != TM_ECODE_OK) { SCLogError("initializing flow log API for thread failed"); SCFree(ftd); return TM_ECODE_FAILED; diff --git a/src/flow-worker.c b/src/flow-worker.c index 3bb91adf5a..331f6ea708 100644 --- a/src/flow-worker.c +++ b/src/flow-worker.c @@ -289,7 +289,7 @@ static TmEcode FlowWorkerThreadInit(ThreadVars *tv, const void *initdata, void * FlowWorkerThreadDeinit(tv, fw); return TM_ECODE_FAILED; } - if (OutputFlowLogThreadInit(tv, NULL, &fw->output_thread_flow) != TM_ECODE_OK) { + if (OutputFlowLogThreadInit(tv, &fw->output_thread_flow) != TM_ECODE_OK) { SCLogError("initializing flow log API for thread failed"); FlowWorkerThreadDeinit(tv, fw); return TM_ECODE_FAILED; diff --git a/src/output-flow.c b/src/output-flow.c index 85a2d7164d..d738152953 100644 --- a/src/output-flow.c +++ b/src/output-flow.c @@ -120,7 +120,7 @@ TmEcode OutputFlowLog(ThreadVars *tv, void *thread_data, Flow *f) /** \brief thread init for the flow logger * This will run the thread init functions for the individual registered * loggers */ -TmEcode OutputFlowLogThreadInit(ThreadVars *tv, void *initdata, void **data) +TmEcode OutputFlowLogThreadInit(ThreadVars *tv, void **data) { OutputFlowLoggerThreadData *td = SCCalloc(1, sizeof(*td)); if (td == NULL) diff --git a/src/output-flow.h b/src/output-flow.h index 6fb7fcbb23..86e0e00de0 100644 --- a/src/output-flow.h +++ b/src/output-flow.h @@ -38,7 +38,7 @@ int OutputRegisterFlowLogger(const char *name, FlowLogger LogFunc, void OutputFlowShutdown(void); TmEcode OutputFlowLog(ThreadVars *tv, void *thread_data, Flow *f); -TmEcode OutputFlowLogThreadInit(ThreadVars *tv, void *initdata, void **data); +TmEcode OutputFlowLogThreadInit(ThreadVars *tv, void **data); TmEcode OutputFlowLogThreadDeinit(ThreadVars *tv, void *thread_data); #endif /* SURICATA_OUTPUT_FLOW_H */