]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: quic: use datagram destination as source for stateless reset
authorYeonggi Kim <yg.kim@navercorp.com>
Thu, 15 Oct 2026 23:45:55 +0000 (08:45 +0900)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 16 Oct 2026 07:31:06 +0000 (09:31 +0200)
commitf633d891786dfca7580f48e966b8017094746ad6
treeca29e82986a133a85f43e7e143ee65f357b27fe8
parenta0ddcac11b5417dbdd6004ef6b418acd7e7a95a0
BUG/MINOR: quic: use datagram destination as source for stateless reset

When a QUIC listener is bound on a wildcard address, the source address
of emitted datagrams must be the local address targeted by the client,
else the kernel selects it from the route to the client. Both may differ
when several addresses are assigned to the host, for example VIPs
configured on a loopback interface behind a load balancer in direct
routing mode. In this case, QUIC clients relying on a connected UDP
socket silently drop the datagram.

Stateless reset packets are emitted without connection, via
send_stateless_reset() which used a bare sendto() on the listener socket
without source address. In the above conditions, the client never
receives the stateless reset. This typically happens after a restart of
haproxy with a configured cluster-secret, for clients which still use
connection IDs of the previous process: instead of being notified
immediately, they only give up after their idle timeout.

Fix this by adding a source address parameter to send_stateless_reset(),
before the destination one, similarly to the previous patch for Retry.
Its caller sets it to the datagram destination address, and emission
now relies on quic_lstnr_sock_send(), which only uses it if the listener
is bound on a wildcard address. Apart from the source address, the
emission is unchanged.

This should fix github issue #3503.

This should be backported up to 2.8. Note that it relies on the first
two patches of the series:
  - MINOR: quic: use the listener for Retry and Version Negotiation emission
  - MINOR: quic: define a function to emit a datagram on a listener socket
Prior to 3.4, quic_dgram addresses are of sockaddr_storage type, so the
casts are not necessary. Prior to 2.9, send_stateless_reset() is a
static function defined in quic_conn.c.
include/haproxy/quic_tx.h
src/quic_rx.c
src/quic_tx.c