]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
DNP3: disable in case of no dnp3 config
authorVictor Julien <victor@inliniac.net>
Mon, 31 Oct 2016 12:40:19 +0000 (13:40 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 31 Oct 2016 12:40:19 +0000 (13:40 +0100)
src/app-layer-dnp3.c
src/app-layer-modbus.c

index a2bba227027eed8c6df9e78109b77798b09173d9..c5cb45480f59aea07026a7772d665a9054cb6410 100644 (file)
@@ -1585,8 +1585,8 @@ void RegisterDNP3Parsers(void)
 
     char *proto_name = "dnp3";
 
-    if (AppLayerProtoDetectConfProtoDetectionEnabled("tcp", proto_name)) {
-
+    if (AppLayerProtoDetectConfProtoDetectionEnabled("tcp", proto_name))
+    {
         AppLayerProtoDetectRegisterProtocol(ALPROTO_DNP3, proto_name);
 
         if (RunmodeIsUnittests()) {
@@ -1598,24 +1598,19 @@ void RegisterDNP3Parsers(void)
             if (!AppLayerProtoDetectPPParseConfPorts("tcp", IPPROTO_TCP,
                     proto_name, ALPROTO_DNP3, 0, sizeof(DNP3LinkHeader),
                     DNP3ProbingParser)) {
-                SCLogWarning(SC_ERR_DNP3_CONFIG,
-                    "No DNP3 configuration found, enabling DNP3 detection on "
-                    "port " DNP3_DEFAULT_PORT);
-                AppLayerProtoDetectPPRegister(IPPROTO_TCP, DNP3_DEFAULT_PORT,
-                    ALPROTO_DNP3, 0, sizeof(DNP3LinkHeader), STREAM_TOSERVER,
-                    DNP3ProbingParser);
+                return;
             }
         }
 
     }
     else {
-        SCLogInfo("Protocol detection and parser disabled for DNP3.");
+        SCLogConfig("Protocol detection and parser disabled for DNP3.");
         SCReturn;
     }
 
-    if (AppLayerParserConfParserEnabled("tcp", proto_name)) {
-
-        SCLogInfo("Registering DNP3/tcp parsers.");
+    if (AppLayerParserConfParserEnabled("tcp", proto_name))
+    {
+        SCLogConfig("Registering DNP3/tcp parsers.");
 
         AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_DNP3, STREAM_TOSERVER,
             DNP3ParseRequest);
@@ -1649,7 +1644,7 @@ void RegisterDNP3Parsers(void)
             DNP3GetTxLogged, DNP3SetTxLogged);
     }
     else {
-        SCLogInfo("Parser disabled for protocol %s. "
+        SCLogConfig("Parser disabled for protocol %s. "
             "Protocol detection still on.", proto_name);
     }
 
index de09843aa187b9abbf3e9ed9311f6c0f43f898e7..ec75e004718ee59a8213d52bdd4130c58483cd04 100644 (file)
@@ -1490,7 +1490,7 @@ void RegisterModbusParsers(void)
                 stream_depth = value;
             }
         }
-        SCLogInfo("Modbus stream depth: %u", stream_depth);
+        SCLogConfig("Modbus stream depth: %u", stream_depth);
     } else {
 #ifndef AFLFUZZ_APPLAYER
         SCLogConfig("Protocol detection and parser disabled for %s protocol.", proto_name);