From: Shivani Bhardwaj Date: Sat, 15 Mar 2025 09:42:34 +0000 (+0530) Subject: stream: combine statements w same outcome X-Git-Tag: suricata-8.0.0-beta1~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d05e603cdb0988a67449b95223e0cd6b15df8a1;p=thirdparty%2Fsuricata.git stream: combine statements w same outcome --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index c36ab3fe27..faacfa57b9 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -1639,14 +1639,10 @@ static int StreamReassembleRawInline(TcpSession *ssn, const Packet *p, uint32_t chunk_size = PKT_IS_TOSERVER(p) ? stream_config.reassembly_toserver_chunk_size : stream_config.reassembly_toclient_chunk_size; - if (chunk_size <= p->payload_len) { + if ((chunk_size <= p->payload_len) || (((chunk_size / 3) * 2) < p->payload_len)) { chunk_size = p->payload_len + (chunk_size / 3); - SCLogDebug("packet payload len %u, so chunk_size adjusted to %u", - p->payload_len, chunk_size); - } else if (((chunk_size / 3 ) * 2) < p->payload_len) { - chunk_size = p->payload_len + ((chunk_size / 3)); - SCLogDebug("packet payload len %u, so chunk_size adjusted to %u", - p->payload_len, chunk_size); + SCLogDebug( + "packet payload len %u, so chunk_size adjusted to %u", p->payload_len, chunk_size); } const TCPHdr *tcph = PacketGetTCP(p);