From: Victor Julien Date: Wed, 12 Apr 2017 12:31:25 +0000 (+0200) Subject: app-layer: set stream-depth after stream init X-Git-Tag: suricata-4.0.0-beta1~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d562f3b5ee71dc782dd28af1ebe25aaf05fffa3;p=thirdparty%2Fsuricata.git app-layer: set stream-depth after stream init --- diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 483724d480..e69997d71f 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -187,9 +187,6 @@ int AppLayerParserSetup(void) { SCEnter(); - AppProto alproto = 0; - int flow_proto = 0; - memset(&alp_ctx, 0, sizeof(alp_ctx)); /* set the default tx handler if none was set explicitly */ @@ -197,6 +194,14 @@ int AppLayerParserSetup(void) RegisterAppLayerGetActiveTxIdFunc(AppLayerTransactionGetActiveDetectLog); } + SCReturnInt(0); +} + +void AppLayerParserPostStreamSetup(void) +{ + AppProto alproto = 0; + int flow_proto = 0; + /* lets set a default value for stream_depth */ for (flow_proto = 0; flow_proto < FLOW_PROTO_DEFAULT; flow_proto++) { for (alproto = 0; alproto < ALPROTO_MAX; alproto++) { @@ -204,8 +209,6 @@ int AppLayerParserSetup(void) stream_config.reassembly_depth; } } - - SCReturnInt(0); } int AppLayerParserDeSetup(void) diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index c31a9d9a96..c53cf78129 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -65,7 +65,7 @@ uint64_t AppLayerTransactionGetActiveLogOnly(Flow *f, uint8_t flags); int AppLayerParserSetup(void); - +void AppLayerParserPostStreamSetup(void); int AppLayerParserDeSetup(void); typedef struct AppLayerParserThreadCtx_ AppLayerParserThreadCtx; diff --git a/src/suricata.c b/src/suricata.c index 27aa0b47f5..8df7e796d4 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2219,6 +2219,7 @@ void PreRunInit(const int runmode) FlowInitConfig(FLOW_QUIET); IPPairInitConfig(FLOW_QUIET); StreamTcpInitConfig(STREAM_VERBOSE); + AppLayerParserPostStreamSetup(); AppLayerRegisterGlobalCounters(); }