]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: quic: handle ECONNREFUSED on RX side
authorFrederic Lecaille <flecaille@haproxy.com>
Fri, 24 Apr 2026 09:01:37 +0000 (11:01 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Fri, 24 Apr 2026 09:32:45 +0000 (11:32 +0200)
commitd81c9c06a4b1ad951c585cb863d3e60b6656578c
treee45b1ebf72d45167a53c68911cf93c8061a2db9f
parentcc395357029ea5227a0c41ca626aa1789cc73050
BUG/MEDIUM: quic: handle ECONNREFUSED on RX side

Unlike the detection performed during sendto() for an unreachable peer,
ECONNREFUSED was not handled when received via recvmsg() as an ICMP
"host unreachable" message.

This patch tracks ECONNREFUSED errors on the receive path.

Note that this detection is entirely dependent on the remote host effectively
sending an ICMP "host unreachable" message and on the absence of any network
filtering (e.g., firewalls) that would drop such ICMP packets. Without
receiving this ICMP signal, the connection state cannot be updated through
this mechanism.

At a higher level, similar to how this error is handled on sendto(),
the connection is now terminated as soon as possible by calling
qc_kill_conn(). This triggers a call to qc_notify_err(). When the mux
does not exist, it attempts to create one via conn_create_mux(). While
the latter systematically fails if the connection is flagged with
CO_FL_ERROR, it has the useful side effect of waking the stconn stream
attached to the connection during a session opening without a mux
(e.g., for H3).

This issue was caught by haload (upcoming tool).

Must be backported as far as 2.6 because it impacts both the QUIC
frontends and backends.
src/quic_conn.c
src/quic_sock.c