]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: clear SYN queue on state change
authorVictor Julien <vjulien@oisf.net>
Fri, 28 Apr 2023 09:48:31 +0000 (11:48 +0200)
committerVictor Julien <vjulien@oisf.net>
Fri, 28 Apr 2023 12:24:46 +0000 (14:24 +0200)
Bug: #5907.

src/stream-tcp.c

index c1fa6c55f12a4f072ad4d1ba065b5e774fa00417..f544d19506c344e247c92f75e92f6ee9d8d36a05 100644 (file)
@@ -1928,11 +1928,13 @@ static int StreamTcpPacketStateSynSent(
                 SCLogDebug("ssn->server.flags |= STREAMTCP_STREAM_FLAG_RST_RECV");
                 ssn->server.flags |= STREAMTCP_STREAM_FLAG_RST_RECV;
                 StreamTcpCloseSsnWithReset(p, ssn);
+                StreamTcp3wsFreeQueue(ssn);
             }
         } else {
             ssn->client.flags |= STREAMTCP_STREAM_FLAG_RST_RECV;
             SCLogDebug("ssn->client.flags |= STREAMTCP_STREAM_FLAG_RST_RECV");
             StreamTcpCloseSsnWithReset(p, ssn);
+            StreamTcp3wsFreeQueue(ssn);
         }
 
         /* FIN */
@@ -2043,6 +2045,7 @@ static int StreamTcpPacketStateSynSent(
         ssn->flags |= STREAMTCP_FLAG_ASYNC;
         StreamTcpPacketSetState(p, ssn, TCP_ESTABLISHED);
         SCLogDebug("ssn %p: =~ ssn state is now TCP_ESTABLISHED", ssn);
+        StreamTcp3wsFreeQueue(ssn);
 
         ssn->client.window = TCP_GET_WINDOW(p);
         ssn->client.last_ack = TCP_GET_SEQ(p);