From: Victor Julien Date: Mon, 20 May 2024 18:40:22 +0000 (+0200) Subject: pcap-log: always pass 'comp' to PcapWrite X-Git-Tag: suricata-8.0.0-beta1~1283 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c4b96129fb2d94c2c650f6eb74c2aad3a4028b8;p=thirdparty%2Fsuricata.git pcap-log: always pass 'comp' to PcapWrite The variable is always available. --- 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);