From: Philippe Antoine Date: Fri, 1 Jul 2022 11:22:38 +0000 (+0200) Subject: output: use flow's proto for file loggers X-Git-Tag: suricata-6.0.6~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7616%2Fhead;p=thirdparty%2Fsuricata.git 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) --- 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++; }