1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00
Files
John Axel Eriksson 07852cf616 shared/tls: implement Happy Eyeballs (RFC 8305) in RFC3493Dialer
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>
2025-12-16 14:07:07 -05:00
..
2024-04-05 11:11:11 -04:00
2023-09-08 10:36:05 -04:00