From 8c4b96129fb2d94c2c650f6eb74c2aad3a4028b8 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 20 May 2024 20:40:22 +0200 Subject: [PATCH] pcap-log: always pass 'comp' to PcapWrite The variable is always available. --- src/log-pcap.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/log-pcap.c b/src/log-pcap.c index dc14672853..a275eb3804 100644 --- a/src/log-pcap.c +++ b/src/log-pcap.c @@ -650,11 +650,8 @@ static int PcapLog (ThreadVars *t, void *thread_data, const Packet *p) if ((p->flags & PKT_FIRST_ALERTS) && (td->pcap_log->conditional != LOGMODE_COND_ALL)) { if (PacketIsTCP(p)) { /* dump fake packets for all segments we have on acked by packet */ -#ifdef HAVE_LIBLZ4 PcapLogDumpSegments(td, comp, p); -#else - PcapLogDumpSegments(td, NULL, p); -#endif + if (p->flags & PKT_PSEUDO_STREAM_END) { PcapLogUnlock(pl); return TM_ECODE_OK; @@ -678,17 +675,9 @@ static int PcapLog (ThreadVars *t, void *thread_data, const Packet *p) if (p->ttype == PacketTunnelChild) { rp = p->root; -#ifdef HAVE_LIBLZ4 ret = PcapWrite(pl, comp, GET_PKT_DATA(rp), len); -#else - ret = PcapWrite(pl, NULL, GET_PKT_DATA(rp), len); -#endif } else { -#ifdef HAVE_LIBLZ4 ret = PcapWrite(pl, comp, GET_PKT_DATA(p), len); -#else - ret = PcapWrite(pl, NULL, GET_PKT_DATA(p), len); -#endif } if (ret != TM_ECODE_OK) { PCAPLOG_PROFILE_END(pl->profile_write); -- 2.47.2