From ab7677638e09289bd1189eb4c1648d4dd79abb8b Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 22 Nov 2013 18:00:54 +0100 Subject: [PATCH] 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. --- src/stream-tcp-reassemble.c | 5 +++++ 1 file changed, 5 insertions(+) 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;