]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: set stream-depth after stream init
authorVictor Julien <victor@inliniac.net>
Wed, 12 Apr 2017 12:31:25 +0000 (14:31 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 21 Apr 2017 16:51:26 +0000 (18:51 +0200)
src/app-layer-parser.c
src/app-layer-parser.h
src/suricata.c

index 483724d4801adf8fbb8246ea03e74db4121cbba9..e69997d71fcd06d7109924405823c1148eb6eaae 100644 (file)
@@ -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)
index c31a9d9a96849919cc0847da9057368cea40cbbe..c53cf781291385a9be1bbd3c8b450fcb194f98ac 100644 (file)
@@ -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;
index 27aa0b47f502a4189b5ae47b987b345c42cc5935..8df7e796d4adbe3cea8a572ac897636bbcf9b5d5 100644 (file)
@@ -2219,6 +2219,7 @@ void PreRunInit(const int runmode)
     FlowInitConfig(FLOW_QUIET);
     IPPairInitConfig(FLOW_QUIET);
     StreamTcpInitConfig(STREAM_VERBOSE);
+    AppLayerParserPostStreamSetup();
     AppLayerRegisterGlobalCounters();
 }