]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: improve --disable-detection GAP handling
authorVictor Julien <victor@inliniac.net>
Wed, 1 Mar 2017 15:51:22 +0000 (16:51 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 20 Apr 2017 15:41:11 +0000 (17:41 +0200)
src/stream-tcp-list.c

index a532c3cb1037fd282540d7f0a628ec8e3bfc6076..ce35bc04fe1c55c739cffd5e9251118de014103a 100644 (file)
@@ -586,7 +586,7 @@ int StreamTcpReassembleInsertSegment(ThreadVars *tv, TcpReassemblyThreadCtx *ra_
 static inline int SegmentInUse(TcpSession *ssn, TcpStream *stream, TcpSegment *seg)
 {
     /* if proto detect isn't done, we're not returning */
-    if (!(stream->flags & STREAMTCP_STREAM_FLAG_GAP)) {
+    if (!(stream->flags & (STREAMTCP_STREAM_FLAG_GAP|STREAMTCP_STREAM_FLAG_NOREASSEMBLY))) {
         if (!(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(stream))) {
             SCReturnInt(1);
         }
@@ -756,8 +756,9 @@ void StreamTcpPruneSession(Flow *f, uint8_t flags)
         StreamingBufferClear(&stream->sb);
         return;
 
-    } else if ((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED) &&
-        (stream->flags & STREAMTCP_STREAM_FLAG_DISABLE_RAW))
+    } else if (((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED) ||
+                (stream->flags & STREAMTCP_STREAM_FLAG_GAP))     &&
+               (stream->flags & STREAMTCP_STREAM_FLAG_DISABLE_RAW))
     {
         SCLogDebug("ssn %p: both app and raw are done, "
                  "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn);