]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
protodetect: finish probing parser sooner
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 16 Jan 2025 08:26:30 +0000 (09:26 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 21 Jan 2025 17:36:33 +0000 (18:36 +0100)
Ticket: 7495

We want to finish also if we tested all the expected protocols
in mask, or if we tested even more.

There can be one more protocol coming from pe0, which can be
the protocol already found in the other direction.

src/app-layer-detect-proto.c

index af98c6cbe2fe7b77852b9461413f9d848c6bc93b..7e25a25a9d7971afff969318764c7f2f9d29d707 100644 (file)
@@ -626,7 +626,7 @@ again_midstream:
         else if (pp_port_sp)
             mask = pp_port_sp->alproto_mask;
 
-        if (alproto_masks[0] == mask) {
+        if ((alproto_masks[0] & mask) == mask) {
             FLOW_SET_PP_DONE(f, dir);
             SCLogDebug("%s, mask is now %08x, needed %08x, so done",
                     (dir == STREAM_TOSERVER) ? "toserver":"toclient",