Skip to content

Commit

Permalink
Fix for #1003.
Browse files Browse the repository at this point in the history
Now that we call stream reassembly directly from proto detection, we will
need to check if reassembly has been disabled inside the stream reassembly
callback.

This prevents any calls to bypass and re-enter proto detection, despite
having reassembly disabled.
  • Loading branch information
poona authored and victorjulien committed Nov 4, 2013
1 parent 7ebd1e6 commit 95ed53c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/stream-tcp-reassemble.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,14 @@ int StreamTcpReassembleInlineAppLayer(ThreadVars *tv,

uint8_t flags = 0;

/* this function can be directly called by app layer protocol
* detection. */
if (stream->flags & STREAMTCP_STREAM_FLAG_NOREASSEMBLY) {
SCLogDebug("stream no reassembly flag set. Mostly called via "
"app proto detection.");
SCReturnInt(0);
}

SCLogDebug("pcap_cnt %"PRIu64", len %u", p->pcap_cnt, p->payload_len);

SCLogDebug("stream->seg_list %p", stream->seg_list);
Expand Down Expand Up @@ -2597,6 +2605,14 @@ int StreamTcpReassembleAppLayer (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
{
SCEnter();

/* this function can be directly called by app layer protocol
* detection. */
if (stream->flags & STREAMTCP_STREAM_FLAG_NOREASSEMBLY) {
SCLogDebug("stream no reassembly flag set. Mostly called via "
"app proto detection.");
SCReturnInt(0);
}

uint8_t flags = 0;

SCLogDebug("stream->seg_list %p", stream->seg_list);
Expand Down

0 comments on commit 95ed53c

Please sign in to comment.