]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output: use flow's proto for file loggers
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 1 Jul 2022 11:22:38 +0000 (13:22 +0200)
committerPhilippe Antoine <pantoine@oisf.net>
Mon, 4 Jul 2022 08:19:13 +0000 (10:19 +0200)
As there can be an ICMP packet which gets related to a TCP flow.

Ticket: #5408

src/output-file.c
src/output-filedata.c

index 832e2e9923044f1b4d653b2ecb4162b9b45bfe69..f62e846b37470a8847217be3056578d167ff87e9 100644 (file)
@@ -97,9 +97,9 @@ int OutputRegisterFileLogger(LoggerId id, const char *name, FileLogger LogFunc,
 static void CloseFile(const Packet *p, Flow *f, File *file)
 {
     DEBUG_VALIDATE_BUG_ON((file->flags & FILE_LOGGED) != 0);
-    void *txv = AppLayerParserGetTx(p->proto, f->alproto, f->alstate, file->txid);
+    void *txv = AppLayerParserGetTx(f->proto, f->alproto, f->alstate, file->txid);
     if (txv) {
-        AppLayerTxData *txd = AppLayerParserGetTxData(p->proto, f->alproto, txv);
+        AppLayerTxData *txd = AppLayerParserGetTxData(f->proto, f->alproto, txv);
         if (txd) {
             txd->files_logged++;
             DEBUG_VALIDATE_BUG_ON(txd->files_logged > txd->files_opened);
index 2b09fe311473cd1dbbd45c2bed85f506fcb34888..2dea84817fe9b7ce3b9602f88f4253a8265ef0bf 100644 (file)
@@ -125,9 +125,9 @@ static int CallLoggers(ThreadVars *tv, OutputLoggerThreadStore *store_list,
 
 static void CloseFile(const Packet *p, Flow *f, File *file)
 {
-    void *txv = AppLayerParserGetTx(p->proto, f->alproto, f->alstate, file->txid);
+    void *txv = AppLayerParserGetTx(f->proto, f->alproto, f->alstate, file->txid);
     if (txv) {
-        AppLayerTxData *txd = AppLayerParserGetTxData(p->proto, f->alproto, txv);
+        AppLayerTxData *txd = AppLayerParserGetTxData(f->proto, f->alproto, txv);
         if (txd)
             txd->files_stored++;
     }