]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output: use flow's proto for file loggers 7616/head
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 1 Jul 2022 11:22:38 +0000 (13:22 +0200)
committerJason Ish <jason.ish@oisf.net>
Wed, 6 Jul 2022 15:42:22 +0000 (10:42 -0500)
As there can be an ICMP packet which gets related to a TCP flow.

Ticket: #5408
(cherry picked from commit 5781631f858b078ad8e5d7982074f41a08699ee2)

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

index e12d0146a9bea9b7de85d7458add718fc0891af4..593c3b6dd4d134338745d041c0b3e1fff9ee119d 100644 (file)
@@ -101,7 +101,7 @@ int OutputRegisterFileLogger(LoggerId id, const char *name, FileLogger LogFunc,
 
 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);
         if (txd)
index 784d4d18d70360e4f536b2592eaebaf8b3446e44..35ed4968fe8dee66b02364ef3a971da0b2c87f44 100644 (file)
@@ -134,9 +134,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++;
     }