]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: connections: Really enforce mux protocol requirements
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 8 Apr 2026 14:02:06 +0000 (16:02 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 8 Apr 2026 16:41:48 +0000 (18:41 +0200)
Commit 1b0dfff552713274b95c81594b153104e215ec81 attempted to make it so
the mux would expect a QUIC-like protocol or not, however it only made
that we would not instantiate a non-QUIC mux on a QUIC protocol, but not
that we tried to instance a QUIC mux on a non-QUIC protocol, so fix
that.

include/haproxy/connection.h

index c6e11273388b28a7acc14e663de1db5ed2da4b3e..3fb5933c456b4feb64093b7f9a26823c3476165f 100644 (file)
@@ -616,10 +616,11 @@ static inline const struct mux_proto_list *conn_get_best_mux_entry(
        struct mux_proto_list *fallback = NULL;
 
        list_for_each_entry(item, &mux_proto_list.list, list) {
-               if (!(item->side & proto_side) || !(item->mode & proto_mode) || (proto_is_quic && !(item->mux->flags & MX_FL_FRAMED)))
+               if (!(item->side & proto_side) || !(item->mode & proto_mode) || ((proto_is_quic != 0) != ((item->mux->flags & MX_FL_FRAMED) != 0)))
                        continue;
-               if (istlen(mux_proto) && isteq(mux_proto, item->token))
+               if (istlen(mux_proto) && isteq(mux_proto, item->token)) {
                        return item;
+               }
                else if (!istlen(item->token)) {
                        if (!fallback || (item->mode == proto_mode && fallback->mode != proto_mode))
                                fallback = item;