]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: mux_quic: prevent QMux crash on qcc_io_send() error path
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 10 Apr 2026 08:37:09 +0000 (10:37 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Apr 2026 07:11:08 +0000 (09:11 +0200)
A QCC connection may be flagged with QC_CF_ERRL to trigger a
CONNECTION_CLOSE emission. However, for now error reporting is not
functional with QMux, as it relies on quic_conn layer access.

To prevent a crash in qcc_io_send() when using QMux, add a
conn_is_quic() check when QC_CF_ERRL is set to ensure no access will be
performed on quic_conn layer. In the future, this should be extended so
that QMux is also able to emit CONNECTION_CLOSE for connection closure.

No need to backport.

src/mux_quic.c

index 0ea65fefc9d6e05ddf2811cce28b0acc4ebea6a1..0fe0c7c6f515e8c5705694fa4be6548717c748ba 100644 (file)
@@ -3032,7 +3032,9 @@ static int qcc_io_send(struct qcc *qcc)
                /* Prepare a CONNECTION_CLOSE if not already done. */
                if (!(qcc->flags & QC_CF_ERRL_DONE)) {
                        TRACE_DATA("report a connection error", QMUX_EV_QCC_SEND|QMUX_EV_QCC_ERR, qcc->conn);
-                       quic_set_connection_close(qcc->conn->handle.qc, qcc->err);
+                       /* TODO implement a QMux alternative */
+                       if (conn_is_quic(qcc->conn))
+                               quic_set_connection_close(qcc->conn->handle.qc, qcc->err);
                        qcc->flags |= QC_CF_ERRL_DONE;
                }
                goto out;