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-7.0.0-beta1~384 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5781631f858b078ad8e5d7982074f41a08699ee2;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 --- diff --git a/src/output-file.c b/src/output-file.c index 832e2e9923..f62e846b37 100644 --- a/src/output-file.c +++ b/src/output-file.c @@ -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); diff --git a/src/output-filedata.c b/src/output-filedata.c index 2b09fe3114..2dea84817f 100644 --- a/src/output-filedata.c +++ b/src/output-filedata.c @@ -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++; }