From a71a474302465bc1462f4888972e9e1298487330 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Fri, 1 Jul 2022 13:22:38 +0200 Subject: [PATCH] output: use flow's proto for file loggers 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 | 2 +- src/output-filedata.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/output-file.c b/src/output-file.c index e12d0146a9..593c3b6dd4 100644 --- a/src/output-file.c +++ b/src/output-file.c @@ -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) diff --git a/src/output-filedata.c b/src/output-filedata.c index 784d4d18d7..35ed4968fe 100644 --- a/src/output-filedata.c +++ b/src/output-filedata.c @@ -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++; } -- 2.47.2