From d815d0748cc28edc76a7a2f9dff253bef2e46437 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 22 Aug 2025 16:30:29 +0200 Subject: [PATCH] stream: avoid ineffective state bump in TFO Do not set session state to established, as it is unconditionally overwritten to syn_recv afterwards. --- src/stream-tcp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 9270dba1d7..3921c7030d 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -1859,10 +1859,7 @@ static void TcpStateQueueInitFromPktSynAck(const Packet *p, TcpStateQueue *q) { #if defined(DEBUG_VALIDATION) || defined(DEBUG) const TcpSession *ssn = p->flow->protoctx; - if ((ssn->flags & STREAMTCP_FLAG_TCP_FAST_OPEN) == 0) - BUG_ON(ssn->state != TCP_SYN_SENT); - else - BUG_ON(ssn->state != TCP_ESTABLISHED); + BUG_ON(ssn->state != TCP_SYN_SENT); #endif memset(q, 0, sizeof(*q)); @@ -2020,7 +2017,6 @@ static int StreamTcpPacketStateSynSent( return -1; } ssn->flags |= STREAMTCP_FLAG_TCP_FAST_OPEN; - StreamTcpPacketSetState(p, ssn, TCP_ESTABLISHED); } const bool ts_mismatch = !StateSynSentValidateTimestamp(ssn, p);