]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: improve raw reassembly
authorVictor Julien <victor@inliniac.net>
Fri, 22 Nov 2013 17:00:54 +0000 (18:00 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 22 Nov 2013 17:00:54 +0000 (18:00 +0100)
When checking the reassembly limit for raw reassembly, consider the
STREAMTCP_STREAM_FLAG_NOREASSEMBLY a trigger immediately. We won't
process any more segments in the reassembly engine anyway.

src/stream-tcp-reassemble.c

index 97524d0616eeab22de3b6dda3c00c75857e326ce..9c97161e5c14a4cd6b9d05079a1e3f5f908354ea 100644 (file)
@@ -1764,6 +1764,11 @@ static int StreamTcpReassembleRawCheckLimit(TcpSession *ssn, TcpStream *stream,
 {
     SCEnter();
 
+    if (stream->flags & STREAMTCP_STREAM_FLAG_NOREASSEMBLY) {
+        SCLogDebug("reassembling now as STREAMTCP_STREAM_FLAG_NOREASSEMBLY is set, so not expecting any new packets");
+        SCReturnInt(1);
+    }
+
     if (ssn->flags & STREAMTCP_FLAG_TRIGGER_RAW_REASSEMBLY) {
         SCLogDebug("reassembling now as STREAMTCP_FLAG_TRIGGER_RAW_REASSEMBLY is set");
         ssn->flags &= ~STREAMTCP_FLAG_TRIGGER_RAW_REASSEMBLY;