From: Anoop Saldanha Date: Thu, 3 Oct 2013 04:40:11 +0000 (+0530) Subject: Reset app layer processed flag for segments that have been sent for proto X-Git-Tag: suricata-2.0beta2~229 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=836bad85a47f4e9f5f34472534c3e77bd39b3dc9;p=thirdparty%2Fsuricata.git Reset app layer processed flag for segments that have been sent for proto detection, but we failed to figure out the proto. Updated a unittest to reflect the above change. --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index dbda9261ad..3c17ba6a8c 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -2959,6 +2959,12 @@ int StreamTcpReassembleAppLayer (ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx, /* store ra_base_seq in the stream */ if (StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(stream)) { stream->ra_app_base_seq = ra_base_seq; + } else { + TcpSegment *tmp_seg = stream->seg_list; + while (tmp_seg != NULL) { + tmp_seg->flags &= ~SEGMENTTCP_FLAG_APPLAYER_PROCESSED; + tmp_seg = tmp_seg->next; + } } SCLogDebug("stream->ra_app_base_seq %u", stream->ra_app_base_seq); SCReturnInt(0); @@ -6855,7 +6861,7 @@ static int StreamTcpReassembleTest40 (void) { /* check is have the segment in the list and flagged or not */ if (ssn.client.seg_list == NULL || - !(ssn.client.seg_list->flags & SEGMENTTCP_FLAG_APPLAYER_PROCESSED)) + (ssn.client.seg_list->flags & SEGMENTTCP_FLAG_APPLAYER_PROCESSED)) { printf("the list is NULL or the processed segment has not been flaged (7): "); goto end;