From 7ca94ba0a2de18726bb7ebae125bdecef06c2ad4 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 21 Apr 2020 10:52:04 +0200 Subject: [PATCH] app-layer: fix protocol detection bail conditions for TCP fastopen --- src/app-layer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app-layer.c b/src/app-layer.c index e69db23cf9..0be5acf611 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -198,6 +198,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);