From 73621adb23688d421c43df42f85f5171c2b3eafe Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Thu, 6 Nov 2025 14:45:33 +0100 Subject: [PATCH] BUG/MINOR: quic: close connection on CID alloc failure During RETIRE_CONNECTION_ID frame parsing, a new connection ID is immediately reallocated after the release of the previous one. This is done to ensure that the peer will never run out of DCID. Prior to this patch, a CID allocation failure was be silently ignored. This prevent the emission of a new CID, which could prevent the peer to emit packets if it had no other CIDs available for use. Now, such error is considered fatal to the connection. This is the safest solution as it's better to close connections when memory is running low. It must be backported up to 2.8. --- src/quic_rx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/quic_rx.c b/src/quic_rx.c index a05214857..6da808d37 100644 --- a/src/quic_rx.c +++ b/src/quic_rx.c @@ -1020,6 +1020,9 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt, conn_id = new_quic_cid(qc->cids, qc, NULL, NULL); if (!conn_id) { TRACE_ERROR("CID allocation error", QUIC_EV_CONN_IO_CB, qc); + quic_set_connection_close(qc, quic_err_transport(QC_ERR_INTERNAL_ERROR)); + qc_notify_err(qc); + goto err; } else { _quic_cid_insert(conn_id);