mirror of
https://github.com/lxc/incus.git
synced 2026-02-05 09:46:19 +01:00
The RFC3493Dialer function, before this, tried addresses sequentially with a 10-second timeout per address. This causes problems in dual-stack environments where one address family is unreachable: - If DNS returns IPv4 addresses first but IPv4 is unreachable (e.g., in IPv6-only environments), the dialer would spend 10+ seconds timing out on each IPv4 address before trying IPv6. - This exceeded typical HTTP client timeouts, causing connection failures even when IPv6 connectivity was available. This change implements Happy Eyeballs (RFC 8305): 1. Sort addresses with IPv6 first (RFC 8305 recommends preferring IPv6) 2. Start connection attempts with a 250ms staggered delay (per RFC 8305) 3. Return the first successful connection immediately 4. Finally clean up unused connections Signed-off-by: John Axel Eriksson <john@insane.se>