From: Shivani Bhardwaj Date: Tue, 7 Sep 2021 00:20:11 +0000 (+0530) Subject: applayer: error if probes are null but port is not X-Git-Tag: suricata-7.0.0-beta1~1400 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d166acbdabd4c3ad4be655040ea64c2e257c6717;p=thirdparty%2Fsuricata.git applayer: error if probes are null but port is not If the default port is set via the Rust registration table but the probe fns to server and to client are set to None, the port is never used. Setting port in such a case is useless so error out. --- diff --git a/src/app-layer-register.c b/src/app-layer-register.c index dcf82aa8b7..fe2e80bc74 100644 --- a/src/app-layer-register.c +++ b/src/app-layer-register.c @@ -55,6 +55,7 @@ AppProto AppLayerRegisterProtocolDetection(const struct AppLayerParser *p, int e AppLayerProtoDetectRegisterProtocol(alproto, p->name); if (p->ProbeTS == NULL && p->ProbeTC == NULL) { + BUG_ON(p->default_port != NULL); return alproto; }