From: Victor Julien Date: Tue, 18 Apr 2023 11:48:46 +0000 (+0200) Subject: stream: check debug check for multi-SYN/ACK in TFO X-Git-Tag: suricata-6.0.12~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10d6c8796e42d23c0046d91eec66f0b8136cec17;p=thirdparty%2Fsuricata.git stream: check debug check for multi-SYN/ACK in TFO (cherry picked from commit 89c947129dff0e197359f94c3a8d9105d11bad62) --- diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 1555cbdd09..6c83ffb061 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -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));