mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-01 14:12:32 -08:00
nodeBackend rebuilt extraDNS from DNS.ExtraRecords as a map[string]netip.Addr, so a Service's A and AAAA records under the same name overwrote each other and only the last one (the AAAA, i.e. the IPv6 VIP) survived. resolveMagicDNS then returned only the IPv6 VIP for UserDial dials of the Service name, with no IPv4 fallback, and a tcp4 dial of the name failed outright. Keep every address per name (map[string][]netip.Addr) and select among them with the same addrForNetwork helper used for device names, which prefers IPv4 for unqualified networks and honors tcp4/tcp6. This makes outbound HTTP proxy, SOCKS5, and 'tailscale nc' dials of Service names reach the IPv4 VIP in IPv4-only deployments (e.g. Kubernetes operator ingress ProxyGroups). Fixes #22261 Signed-off-by: evan188199-tech <[email protected]>