From: Victor Julien Date: Thu, 13 Feb 2014 14:02:57 +0000 (+0100) Subject: app-layer-event: make error reporting more clear X-Git-Tag: suricata-2.0rc2~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad51a57b91815c2d131ae713dcc49b2901d60cdd;p=thirdparty%2Fsuricata.git app-layer-event: make error reporting more clear If the protocol is disabled, app-layer-event would print a cryptic error message. This patch makes sure we inform the user the protocol is in fact disabled. --- diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index 5b0b70e59b..bc8fa81bf4 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -149,6 +149,7 @@ static int DetectAppLayerEventParseAppP2(DetectAppLayerEventData *data, } else if (ipproto_bitarray[IPPROTO_UDP / 8] & 1 << (IPPROTO_UDP % 8)) { ipproto = IPPROTO_UDP; } else { + SCLogError(SC_ERR_INVALID_SIGNATURE, "protocol %s is disabled", alproto_name); return -1; } @@ -226,10 +227,8 @@ static int DetectAppLayerEventSetupP2(Signature *s, AppLayerEventType event_type = 0; if (DetectAppLayerEventParseAppP2(sm->ctx, s->proto.proto, - &event_type) < 0) - { - SCLogError(SC_ERR_INVALID_SIGNATURE, "App layer event setup " - "phase2 failure."); + &event_type) < 0) { + /* DetectAppLayerEventParseAppP2 prints errors */ return -1; } if (event_type == APP_LAYER_EVENT_TYPE_GENERAL)