I have a host that may only have IPv6 external connectivity, or only IPv4, or both.
The serverUDPAddr function will always resolve to IPv4 addresses, even if there is no default route or any sign of external connectivity. Ideally, having a server that is capable of both IPv4 and IPv6 one should be tried and then if that doesn't work it should try with the other. Right now, only IPv4 will be tried.
Example where the DNS resolution works since the system uses IPv6 DNS resolvers, but roughtime is not able to connect:
1970/01/01 00:11:02 Failed to get roughtime from roughtime.sandbox.google.com:2002 (skipping): dial udp 64.233.164.158:2002: connect: network is unreachable
Hi,
I have a host that may only have IPv6 external connectivity, or only IPv4, or both.
The serverUDPAddr function will always resolve to IPv4 addresses, even if there is no default route or any sign of external connectivity. Ideally, having a server that is capable of both IPv4 and IPv6 one should be tried and then if that doesn't work it should try with the other. Right now, only IPv4 will be tried.
Example where the DNS resolution works since the system uses IPv6 DNS resolvers, but roughtime is not able to connect: