detect: logs an error if a protocol is disabled

So that the user knows that the rule cannot match
pull/6894/head
Philippe Antoine 4 years ago committed by Victor Julien
parent bf30eb344a
commit 1e1a4ab1c4

@ -1507,6 +1507,11 @@ int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
}
}
if (AppLayerProtoDetectGetProtoName(alproto) == NULL) {
SCLogError(SC_ERR_INVALID_ARGUMENT, "disabled alproto %s, rule can never match",
AppProtoToString(alproto));
return -1;
}
s->alproto = alproto;
s->flags |= SIG_FLAG_APPLAYER;
return 0;

Loading…
Cancel
Save