DNP3: disable in case of no dnp3 config

pull/2393/head
Victor Julien 10 years ago
parent 12849fa927
commit 080a2f0cfb

@ -1585,8 +1585,8 @@ void RegisterDNP3Parsers(void)
char *proto_name = "dnp3"; char *proto_name = "dnp3";
if (AppLayerProtoDetectConfProtoDetectionEnabled("tcp", proto_name)) { if (AppLayerProtoDetectConfProtoDetectionEnabled("tcp", proto_name))
{
AppLayerProtoDetectRegisterProtocol(ALPROTO_DNP3, proto_name); AppLayerProtoDetectRegisterProtocol(ALPROTO_DNP3, proto_name);
if (RunmodeIsUnittests()) { if (RunmodeIsUnittests()) {
@ -1598,24 +1598,19 @@ void RegisterDNP3Parsers(void)
if (!AppLayerProtoDetectPPParseConfPorts("tcp", IPPROTO_TCP, if (!AppLayerProtoDetectPPParseConfPorts("tcp", IPPROTO_TCP,
proto_name, ALPROTO_DNP3, 0, sizeof(DNP3LinkHeader), proto_name, ALPROTO_DNP3, 0, sizeof(DNP3LinkHeader),
DNP3ProbingParser)) { DNP3ProbingParser)) {
SCLogWarning(SC_ERR_DNP3_CONFIG, return;
"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);
} }
} }
} }
else { else {
SCLogInfo("Protocol detection and parser disabled for DNP3."); SCLogConfig("Protocol detection and parser disabled for DNP3.");
SCReturn; SCReturn;
} }
if (AppLayerParserConfParserEnabled("tcp", proto_name)) { if (AppLayerParserConfParserEnabled("tcp", proto_name))
{
SCLogInfo("Registering DNP3/tcp parsers."); SCLogConfig("Registering DNP3/tcp parsers.");
AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_DNP3, STREAM_TOSERVER, AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_DNP3, STREAM_TOSERVER,
DNP3ParseRequest); DNP3ParseRequest);
@ -1649,7 +1644,7 @@ void RegisterDNP3Parsers(void)
DNP3GetTxLogged, DNP3SetTxLogged); DNP3GetTxLogged, DNP3SetTxLogged);
} }
else { else {
SCLogInfo("Parser disabled for protocol %s. " SCLogConfig("Parser disabled for protocol %s. "
"Protocol detection still on.", proto_name); "Protocol detection still on.", proto_name);
} }

@ -1490,7 +1490,7 @@ void RegisterModbusParsers(void)
stream_depth = value; stream_depth = value;
} }
} }
SCLogInfo("Modbus stream depth: %u", stream_depth); SCLogConfig("Modbus stream depth: %u", stream_depth);
} else { } else {
#ifndef AFLFUZZ_APPLAYER #ifndef AFLFUZZ_APPLAYER
SCLogConfig("Protocol detection and parser disabled for %s protocol.", proto_name); SCLogConfig("Protocol detection and parser disabled for %s protocol.", proto_name);

Loading…
Cancel
Save