diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index bae74b6ee6..d8625bb4a5 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -360,7 +360,7 @@ uint16_t AppLayerDetectGetProto(AlpProtoDetectCtx *ctx, AlpProtoDetectThreadCtx AlpProtoDetectDirection *dir; AlpProtoDetectDirectionThread *tdir; - if (flags & FLOW_AL_STREAM_TOSERVER) { + if (flags & STREAM_TOSERVER) { dir = &ctx->toserver; tdir = &tctx->toserver; } else { diff --git a/src/app-layer.c b/src/app-layer.c index e54e440d0b..f7be83b9d4 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -132,15 +132,6 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, alproto = f->alproto; - /* Copy some needed flags */ - if (flags & STREAM_TOSERVER) { - f->alflags |= FLOW_AL_STREAM_TOSERVER; - SCLogDebug("STREAM_TOSERVER"); - } else if (flags & STREAM_TOCLIENT) { - f->alflags |= FLOW_AL_STREAM_TOCLIENT; - SCLogDebug("STREAM_TOCLIENT"); - } - SCLogDebug("data_len %u flags %02X", data_len, flags); if (!(f->alflags & FLOW_AL_NO_APPLAYER_INSPECTION)) { /* if we don't know the proto yet and we have received a stream @@ -163,7 +154,7 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, } #endif alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, - data, data_len, f->alflags, IPPROTO_TCP); + data, data_len, flags, IPPROTO_TCP); if (alproto != ALPROTO_UNKNOWN) { /* store the proto and setup the L7 data array */ FlowL7DataPtrInit(f); @@ -322,12 +313,6 @@ int AppLayerHandleMsg(AlpProtoDetectThreadCtx *dp_ctx, StreamMsg *smsg) if (ssn != NULL) { alproto = smsg->flow->alproto; - /* Copy some needed flags */ - if (smsg->flags & STREAM_TOSERVER) - smsg->flow->alflags |= FLOW_AL_STREAM_TOSERVER; - if (smsg->flags & STREAM_TOCLIENT) - smsg->flow->alflags |= FLOW_AL_STREAM_TOCLIENT; - if (!(smsg->flow->alflags & FLOW_AL_NO_APPLAYER_INSPECTION)) { /* if we don't know the proto yet and we have received a stream * initializer message, we run proto detection. @@ -476,10 +461,11 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p) alproto = f->alproto; + uint8_t flags = 0; if (p->flowflags & FLOW_PKT_TOSERVER) { - f->alflags |= FLOW_AL_STREAM_TOSERVER; + flags |= STREAM_TOSERVER; } else { - f->alflags |= FLOW_AL_STREAM_TOCLIENT; + flags |= STREAM_TOCLIENT; } /* if we don't know the proto yet and we have received a stream @@ -495,7 +481,7 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p) //printf("=> Init Stream Data -- end\n"); alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, - p->payload, p->payload_len, f->alflags, IPPROTO_UDP); + p->payload, p->payload_len, flags, IPPROTO_UDP); if (alproto != ALPROTO_UNKNOWN) { /* store the proto and setup the L7 data array */ FlowL7DataPtrInit(f); diff --git a/src/flow.h b/src/flow.h index 9a4ec12a88..84ba6520fb 100644 --- a/src/flow.h +++ b/src/flow.h @@ -216,8 +216,6 @@ typedef struct Flow_ /** Flow Application Level flags */ #define FLOW_AL_NO_APPLAYER_INSPECTION 0x04 /** \todo move to flow flags later */ -#define FLOW_AL_STREAM_TOSERVER 0x20 -#define FLOW_AL_STREAM_TOCLIENT 0x40 enum { FLOW_STATE_NEW = 0,