]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
log-pcap: fix inverse logic error
authorJason Ish <jason.ish@oisf.net>
Tue, 24 Jan 2023 22:27:00 +0000 (16:27 -0600)
committerVictor Julien <vjulien@oisf.net>
Thu, 26 Jan 2023 05:57:39 +0000 (06:57 +0100)
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

index df6bf8293074f1acb99b6a86e303e9e82f61f407..670977404213d0e1aabee6ccd997bc8fe8f4a3d2 100644 (file)
@@ -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 {