|
|
|
@ -486,6 +486,7 @@ static int TCPProtoDetect(ThreadVars *tv,
|
|
|
|
|
if (data_len > 0)
|
|
|
|
|
ssn->data_first_seen_dir = APP_LAYER_DATA_ALREADY_SENT_TO_APP_LAYER;
|
|
|
|
|
|
|
|
|
|
if (*alproto_otherdir != ALPROTO_FAILED) {
|
|
|
|
|
PACKET_PROFILING_APP_START(app_tctx, f->alproto);
|
|
|
|
|
int r = AppLayerParserParse(tv, app_tctx->alp_tctx, f,
|
|
|
|
|
f->alproto, flags,
|
|
|
|
@ -494,18 +495,21 @@ static int TCPProtoDetect(ThreadVars *tv,
|
|
|
|
|
|
|
|
|
|
AppLayerDecoderEventsSetEventRaw(&p->app_layer_events,
|
|
|
|
|
APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION);
|
|
|
|
|
StreamTcpSetStreamFlagAppProtoDetectionCompleted(stream);
|
|
|
|
|
TcpSessionSetReassemblyDepth(ssn,
|
|
|
|
|
AppLayerParserGetStreamDepth(f));
|
|
|
|
|
*alproto = ALPROTO_FAILED;
|
|
|
|
|
AppLayerIncFlowCounter(tv, f);
|
|
|
|
|
FlagPacketFlow(p, f, flags);
|
|
|
|
|
|
|
|
|
|
*alproto = *alproto_otherdir;
|
|
|
|
|
SCLogDebug("packet %u: pd done(us %u them %u), parser called (r==%d), APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION set",
|
|
|
|
|
(uint)p->pcap_cnt, *alproto, *alproto_otherdir, r);
|
|
|
|
|
if (r < 0)
|
|
|
|
|
goto failure;
|
|
|
|
|
}
|
|
|
|
|
*alproto = ALPROTO_FAILED;
|
|
|
|
|
StreamTcpSetStreamFlagAppProtoDetectionCompleted(stream);
|
|
|
|
|
AppLayerIncFlowCounter(tv, f);
|
|
|
|
|
FlagPacketFlow(p, f, flags);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
/* both sides unknown, let's see if we need to give up */
|
|
|
|
|
TCPProtoDetectCheckBailConditions(tv, f, ssn, p);
|
|
|
|
|