Skip to content

Commit

Permalink
Reset app layer processed flag for segments that have been sent for p…
Browse files Browse the repository at this point in the history
…roto

detection, but we failed to figure out the proto.

Updated a unittest to reflect the above change.
  • Loading branch information
poona committed Oct 8, 2013
1 parent 87edd2a commit 836bad8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/stream-tcp-reassemble.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 836bad8

Please sign in to comment.