From: Anoop Saldanha Date: Sat, 21 Apr 2012 07:40:59 +0000 (+0530) Subject: remove unused stream ssn flag - STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED X-Git-Tag: suricata-1.3beta2~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=225b917e93358c2e377bee0718c3b273de8e8c06;p=thirdparty%2Fsuricata.git remove unused stream ssn flag - STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED --- diff --git a/src/stream-tcp-private.h b/src/stream-tcp-private.h index e69b556836..fc5ff65383 100644 --- a/src/stream-tcp-private.h +++ b/src/stream-tcp-private.h @@ -112,15 +112,13 @@ enum /** Flag to indicate that this session is possible trying to evade the detection * (http://www.packetstan.com/2010/06/recently-ive-been-on-campaign-to-make.html) */ #define STREAMTCP_FLAG_DETECTION_EVASION_ATTEMPT 0x0200 -/** Flag to indicate that this stream direction has reassembled chunks */ -#define STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED 0x0400 /** Flag to indicate the client (SYN pkt) permits SACK */ -#define STREAMTCP_FLAG_CLIENT_SACKOK 0x0800 +#define STREAMTCP_FLAG_CLIENT_SACKOK 0x0400 /** Flag to indicate both sides of the session permit SACK (SYN + SYN/ACK) */ -#define STREAMTCP_FLAG_SACKOK 0x1000 +#define STREAMTCP_FLAG_SACKOK 0x0800 /** Flag for triggering RAW reassembly before the size limit is reached or the stream reaches EOF. */ -#define STREAMTCP_FLAG_TRIGGER_RAW_REASSEMBLY 0x2000 +#define STREAMTCP_FLAG_TRIGGER_RAW_REASSEMBLY 0x1000 /* * Per STREAM flags diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index f4f8eb60f7..ea9c5a9f4f 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -1826,10 +1826,6 @@ static int StreamTcpReassembleInlineAppLayer (ThreadVars *tv, NULL, 0, flags|STREAM_EOF); PACKET_PROFILING_APP_STORE(&ra_ctx->dp_ctx, p); - /* even if app layer detection failed, we will now move on to - * release reassembly for both directions. */ - ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; - } else { SCLogDebug("no segments in the list to reassemble"); } @@ -1949,8 +1945,6 @@ static int StreamTcpReassembleInlineAppLayer (ThreadVars *tv, /* set a GAP flag and make sure not bothering this stream anymore */ SCLogDebug("set STREAMTCP_STREAM_FLAG_GAP flag"); stream->flags |= STREAMTCP_STREAM_FLAG_GAP; - /* flag reassembly as started, so the to_client part can start */ - ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; StreamTcpSetEvent(p, STREAM_REASSEMBLY_SEQ_GAP); SCPerfCounterIncr(ra_ctx->counter_tcp_reass_gap, tv->sc_perf_pca); @@ -2111,13 +2105,6 @@ static int StreamTcpReassembleInlineAppLayer (ThreadVars *tv, data_sent += data_len; } - if (ssn->flags & STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED) { - SCLogDebug("proto detection already completed"); - ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; - } else { - SCLogDebug("protocol detection not yet completed"); - } - if (data_sent == 0 && ssn->state > TCP_ESTABLISHED) { SCLogDebug("sending empty eof message"); /* send EOF to app layer */ @@ -2125,10 +2112,6 @@ static int StreamTcpReassembleInlineAppLayer (ThreadVars *tv, AppLayerHandleTCPData(&ra_ctx->dp_ctx, p->flow, ssn, NULL, 0, flags|STREAM_EOF); PACKET_PROFILING_APP_STORE(&ra_ctx->dp_ctx, p); - - /* even if app layer detection failed, we will now move on to - * release reassembly for both directions. */ - ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; } /* store ra_base_seq in the stream */ @@ -2504,10 +2487,6 @@ static int StreamTcpReassembleAppLayer (ThreadVars *tv, NULL, 0, flags|STREAM_EOF); PACKET_PROFILING_APP_STORE(&ra_ctx->dp_ctx, p); - /* even if app layer detection failed, we will now move on to - * release reassembly for both directions. */ - ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; - SCReturnInt(0); } } @@ -2638,8 +2617,6 @@ static int StreamTcpReassembleAppLayer (ThreadVars *tv, /* set a GAP flag and make sure not bothering this stream anymore */ SCLogDebug("STREAMTCP_STREAM_FLAG_GAP set"); stream->flags |= STREAMTCP_STREAM_FLAG_GAP; - /* flag reassembly as started, so the to_client part can start */ - ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; StreamTcpSetEvent(p, STREAM_REASSEMBLY_SEQ_GAP); SCPerfCounterIncr(ra_ctx->counter_tcp_reass_gap, tv->sc_perf_pca); @@ -2841,13 +2818,6 @@ static int StreamTcpReassembleAppLayer (ThreadVars *tv, PACKET_PROFILING_APP_STORE(&ra_ctx->dp_ctx, p); } - if (ssn->flags & STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED) { - SCLogDebug("proto detection already completed"); - ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; - } else { - SCLogDebug("protocol detection not yet completed"); - } - /* store ra_base_seq in the stream */ if ((ssn->flags & STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED)) { stream->ra_app_base_seq = ra_base_seq; @@ -2865,15 +2835,7 @@ static int StreamTcpReassembleRaw (TcpReassemblyThreadCtx *ra_ctx, { SCEnter(); SCLogDebug("start p %p", p); -#if 0 - if (PKT_IS_TOSERVER(p) && - !(ssn->flags & STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED)) - { - SCLogDebug("toserver reassembling is not done yet, so " - "skipping reassembling at the moment for to_client"); - SCReturnInt(0); - } -#endif + if (stream->seg_list == NULL) { /* send an empty EOF msg if we have no segments but TCP state * is beyond ESTABLISHED */ @@ -2886,10 +2848,6 @@ static int StreamTcpReassembleRaw (TcpReassemblyThreadCtx *ra_ctx, StreamTcpSetupMsg(ssn, stream, p, smsg); StreamMsgPutInQueue(ra_ctx->stream_q,smsg); - /* even if app layer detection failed, we will now move on to - * release reassembly for both directions. */ - ssn->flags |= STREAMTCP_FLAG_TOSERVER_REASSEMBLY_STARTED; - } else { SCLogDebug("no segments in the list to reassemble"); }