From: Amaury Denoyelle Date: Thu, 14 Apr 2022 12:59:35 +0000 (+0200) Subject: MINOR: quic: emit CONNECTION_CLOSE on app init error X-Git-Tag: v2.6-dev6~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d774dee557710e86b9ed906786ce03f88393c09;p=thirdparty%2Fhaproxy.git MINOR: quic: emit CONNECTION_CLOSE on app init error Emit a CONNECTION_CLOSE if the app layer cannot be properly initialized on qc_xprt_start. This force the quic-conn to enter the closing state before being closed. Without this, quic-conn normal operations continue, despite the app-layer reported as not initialized. This behavior is undefined, in particular when handling STREAM frames. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 528f7c0106..812c253563 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -5756,6 +5756,9 @@ static int qc_xprt_start(struct connection *conn, void *ctx) qc = conn->handle.qc; if (qcc_install_app_ops(qc->qcc, qc->app_ops)) { TRACE_PROTO("Cannot install app layer", QUIC_EV_CONN_LPKT, qc); + /* prepare a CONNECTION_CLOSE frame */ + qc->err_code = QC_ERR_APPLICATION_ERROR; + qc->flags |= QUIC_FL_CONN_IMMEDIATE_CLOSE; return -1; }