From: Victor Julien Date: Mon, 20 May 2024 18:38:26 +0000 (+0200) Subject: pcap-log: don't check variable that is never set X-Git-Tag: suricata-8.0.0-beta1~1285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3eb74c9992d743027be6919d12fe9d8bfb54943f;p=thirdparty%2Fsuricata.git pcap-log: don't check variable that is never set `rotate` was never modified. --- diff --git a/src/log-pcap.c b/src/log-pcap.c index 4442a0f4dd..57a270dab0 100644 --- a/src/log-pcap.c +++ b/src/log-pcap.c @@ -570,7 +570,6 @@ static void PcapLogDumpSegments( static int PcapLog (ThreadVars *t, void *thread_data, const Packet *p) { size_t len; - int rotate = 0; int ret = 0; Packet *rp = NULL; @@ -609,7 +608,7 @@ static int PcapLog (ThreadVars *t, void *thread_data, const Packet *p) PcapLogCompressionData *comp = &pl->compression; if (comp->format == PCAP_LOG_COMPRESSION_FORMAT_NONE) { - if ((pl->size_current + len) > pl->size_limit || rotate) { + if ((pl->size_current + len) > pl->size_limit) { if (PcapLogRotateFile(t,pl) < 0) { PcapLogUnlock(pl); SCLogDebug("rotation of pcap failed"); @@ -625,8 +624,7 @@ static int PcapLog (ThreadVars *t, void *thread_data, const Packet *p) * bytes that have been fed into lz4 since the last write, and * act as if they would be written uncompressed. */ - if ((pl->size_current + comp->bytes_in_block + len) > pl->size_limit || - rotate) { + if ((pl->size_current + comp->bytes_in_block + len) > pl->size_limit) { if (PcapLogRotateFile(t,pl) < 0) { PcapLogUnlock(pl); SCLogDebug("rotation of pcap failed");