]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: mux_quic: fix MAX_STREAMS limit
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 22 Oct 2026 12:22:32 +0000 (14:22 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 22 Oct 2026 13:09:56 +0000 (15:09 +0200)
A peer may emit a MAX_STREAMS frame to increase the window of opened
streams. Such frame is parsed via qcc_recv_max_streams() since 3.3 as it
is mandatory for backend support.

This patch fixes the maximum value authorized in MAX_STREAMS. As
specified by RFC 9000, it cannot exceed 2^60, the maximum number of
streams of a given type, as stream IDs are encoded on 62 bits with the 2
least significant bits reserved for the type.

This must be backported up to 3.3.

src/mux_quic.c

index 97d4b871ebb2830f677bdd27647e6d8242091408..c67364bed2aafdc3f0e24167cdc7a0361d129a2f 100644 (file)
@@ -2316,7 +2316,7 @@ int qcc_recv_max_streams(struct qcc *qcc, uint64_t max, int bidi)
         *  permits opening of a stream larger than this limit MUST be treated
         *  as a connection error of type FRAME_ENCODING_ERROR.
         */
-       if (max > QUIC_VARINT_8_BYTE_MAX) {
+       if (max > ((uint64_t)1 << 60)) {
                TRACE_ERROR("invalid MAX_STREAMS value", QMUX_EV_QCC_RECV, qcc->conn);
                qcc_set_error(qcc, QC_ERR_FRAME_ENCODING_ERROR, 0,
                              muxc_tevt_type_proto_err);