]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: minor code cleanups in ACK validation
authorVictor Julien <vjulien@oisf.net>
Sat, 11 Feb 2023 07:09:17 +0000 (08:09 +0100)
committerVictor Julien <vjulien@oisf.net>
Wed, 15 Feb 2023 11:12:06 +0000 (12:12 +0100)
src/stream-tcp.c

index 5aa519ee66dc54c50aa7abc706ed6fc98583e68d..c8174f387eda58246c062894e622c9e6bbac390d 100644 (file)
@@ -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);
     }