From a0fc00bb480833363af735b7d92f9c6956ddd6dd Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Tue, 24 Jan 2023 16:27:00 -0600 Subject: [PATCH] log-pcap: fix inverse logic error We shouldn't early initialize when *offline*. Instead this accidentally delayed initializing when if an online mode, however its likely not to have been noticed as delaying initializing in online mode is supported as well. --- src/log-pcap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/log-pcap.c b/src/log-pcap.c index df6bf82930..6709774042 100644 --- a/src/log-pcap.c +++ b/src/log-pcap.c @@ -1104,8 +1104,9 @@ static TmEcode PcapLogDataInit(ThreadVars *t, const void *initdata, void **data) #endif /* INIT_RING_BUFFER */ } - /* Don't early initialize output files if in a PCAP file mode. */ - if (IsRunModeOffline(RunmodeGetCurrent())) { + /* Don't early initialize output files if in a PCAP file (offline) + * mode. */ + if (!IsRunModeOffline(RunmodeGetCurrent())) { if (pl->mode == LOGMODE_MULTI) { PcapLogOpenFileCtx(td->pcap_log); } else {