From: Amaury Denoyelle Date: Thu, 28 May 2026 14:44:03 +0000 (+0200) Subject: BUG/MINOR: mux_quic: fix BE conn removal on app shutdown X-Git-Tag: v3.4.0~67 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=c76e0f1bc4d1022b93af2a2e677343b63f45a688;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux_quic: fix BE conn removal on app shutdown When QUIC application layer is shut for a backend connection, the connection is immediately removed from its idle pool. This is a nice optimization as this prevents a future streams to try to reuse an unusable connection. This is implemented since the following commit. 00d668549e46b34d29ea3daa1f6dd42b5251a365 MINOR: mux-quic: do not reuse connection if app already shut However, this removal is not correctly performed as it is used conn_delete_from_tree(). For private connections, this can cause crashes as they are stored in the session instead. Thus, connection status is now properly check, and alternatively session_unown_conn() is used if stored in the session. This must be backported up to 3.3. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index 2edc88b78..58c94a1f0 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -3555,8 +3555,12 @@ static void qcc_app_shutdown(struct qcc *qcc) } /* A connection is not reusable if app layer is closed. */ - if (qcc->flags & QC_CF_IS_BACK) - conn_delete_from_tree(qcc->conn, tid); + if (qcc->flags & QC_CF_IS_BACK) { + if (qcc->conn->flags & CO_FL_LIST_MASK) + conn_delete_from_tree(qcc->conn, tid); + else if (qcc->conn->flags & CO_FL_SESS_IDLE) + session_unown_conn(qcc->conn->owner, qcc->conn); + } out: qcc->app_st = QCC_APP_ST_SHUT;