]> 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>
Thu, 28 May 2026 05:28:41 +0000 (07:28 +0200)
commit197424052071747838d498e65af5b40a07a63584
tree245fa6670a374ac77876a04f9e1ee72c0c823b99
parent7ad81403d05a1defdb0124aa1c191e2970301b5f
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