From: Victor Julien Date: Fri, 22 Nov 2013 17:00:54 +0000 (+0100) Subject: stream: improve raw reassembly X-Git-Tag: suricata-2.0beta2~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab7677638e09289bd1189eb4c1648d4dd79abb8b;p=thirdparty%2Fsuricata.git stream: improve raw reassembly 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. --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 97524d0616..9c97161e5c 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -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;