From: Victor Julien Date: Tue, 21 Apr 2020 08:52:04 +0000 (+0200) Subject: app-layer: fix protocol detection bail conditions for TCP fastopen X-Git-Tag: suricata-5.0.3~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3f3d9e103f3c23ca824ff31074aaa3c85365d79;p=thirdparty%2Fsuricata.git app-layer: fix protocol detection bail conditions for TCP fastopen --- diff --git a/src/app-layer.c b/src/app-layer.c index 9924b8def0..a80f671374 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -199,6 +199,11 @@ static void DisableAppLayer(ThreadVars *tv, Flow *f, Packet *p) static void TCPProtoDetectCheckBailConditions(ThreadVars *tv, Flow *f, TcpSession *ssn, Packet *p) { + if (ssn->state < TCP_ESTABLISHED) { + SCLogDebug("skip as long as TCP is not ESTABLISHED (TCP fast open)"); + return; + } + uint32_t size_ts = ssn->client.last_ack - ssn->client.isn - 1; uint32_t size_tc = ssn->server.last_ack - ssn->server.isn - 1; SCLogDebug("size_ts %u, size_tc %u", size_ts, size_tc);