]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
applayer: error if probes are null but port is not
authorShivani Bhardwaj <shivanib134@gmail.com>
Tue, 7 Sep 2021 00:20:11 +0000 (05:50 +0530)
committerVictor Julien <victor@inliniac.net>
Fri, 17 Sep 2021 09:03:18 +0000 (11:03 +0200)
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.

src/app-layer-register.c

index dcf82aa8b76b5ba82898db6a3199eb89b6dfc876..fe2e80bc7422b0a7b3207cdd21c8799b2bd3c889 100644 (file)
@@ -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;
     }