]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: check debug check for multi-SYN/ACK in TFO
authorVictor Julien <vjulien@oisf.net>
Tue, 18 Apr 2023 11:48:46 +0000 (13:48 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 4 May 2023 13:46:56 +0000 (15:46 +0200)
(cherry picked from commit 89c947129dff0e197359f94c3a8d9105d11bad62)

src/stream-tcp.c

index 1555cbdd09d91e6b5ac938231c6ee01c1503a7d0..6c83ffb0611745e4f9b32a95070073ac5324cf31 100644 (file)
@@ -1520,7 +1520,10 @@ static void TcpStateQueueInitFromPktSynAck(const Packet *p, TcpStateQueue *q)
 {
 #if defined(DEBUG_VALIDATION) || defined(DEBUG)
     const TcpSession *ssn = p->flow->protoctx;
-    BUG_ON(ssn->state != TCP_SYN_SENT);
+    if ((ssn->flags & STREAMTCP_FLAG_TCP_FAST_OPEN) == 0)
+        BUG_ON(ssn->state != TCP_SYN_SENT);
+    else
+        BUG_ON(ssn->state != TCP_ESTABLISHED);
 #endif
     memset(q, 0, sizeof(*q));