]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: fix depth reached detection 2284/head
authorEric Leblond <eric@regit.org>
Tue, 2 Feb 2016 22:44:24 +0000 (23:44 +0100)
committerVictor Julien <victor@inliniac.net>
Sun, 25 Sep 2016 20:38:19 +0000 (22:38 +0200)
When a segment only partially fit in streaming depth, the stream
depth reached flag was not set resulting in a continuous
inspection of the rest of the session.

By setting the stream depth reached flag when the segment partially
fit we avoid to reenter the code and we don't take anymore a code
path resulting in the flag not to be set.

src/stream-tcp-reassemble.c

index 30b725a18df4b3aa9c6cf7c82293f4c3e835c684..28bf4b537ce7d056f5a71ad167aaa56e1143beb8 100644 (file)
@@ -1805,6 +1805,7 @@ static uint32_t StreamTcpReassembleCheckDepth(TcpStream *stream,
             /* complete fit */
             SCReturnUInt(size);
         } else {
+            stream->flags |= STREAMTCP_STREAM_FLAG_DEPTH_REACHED;
             /* partial fit, return only what fits */
             uint32_t part = (stream->isn + stream_config.reassembly_depth) - seq;
 #if DEBUG