From: Victor Julien Date: Sat, 11 Feb 2023 07:09:17 +0000 (+0100) Subject: stream: minor code cleanups in ACK validation X-Git-Tag: suricata-7.0.0-rc2~574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a831b5ea2a311c5bdc688d43238a272170c9a29;p=thirdparty%2Fsuricata.git stream: minor code cleanups in ACK validation --- diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 5aa519ee66..c8174f387e 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -6015,17 +6015,19 @@ static inline int StreamTcpValidateAck(TcpSession *ssn, TcpStream *stream, Packe if (!(p->tcph->th_flags & TH_ACK)) SCReturnInt(0); - uint32_t ack = TCP_GET_ACK(p); + const uint32_t ack = TCP_GET_ACK(p); /* fast track */ if (SEQ_GT(ack, stream->last_ack) && SEQ_LEQ(ack, stream->next_win)) { - SCLogDebug("ACK in bounds"); + SCLogDebug("ssn %p: ACK %u in bounds > %u <= %u", ssn, ack, stream->last_ack, + stream->next_win); SCReturnInt(0); } /* fast track */ else if (SEQ_EQ(ack, stream->last_ack)) { - SCLogDebug("pkt ACK %"PRIu32" == stream last ACK %"PRIu32, TCP_GET_ACK(p), stream->last_ack); + SCLogDebug("ssn %p: pkt ACK %" PRIu32 " == stream last ACK %" PRIu32, ssn, TCP_GET_ACK(p), + stream->last_ack); SCReturnInt(0); }