heistp / irtt

Isochronous Round-Trip Tester
GNU General Public License v2.0
185 stars 23 forks source link

switch to Lookup* methods for name resolution #30

Open heistp opened 2 years ago

heistp commented 2 years ago

We use ResolveUDPAddr to convert host names to IP addresses, for but "historical reasons", this prefers IPv4 over IPv6, despite the ordering that the local resolver uses (sort of related: https://github.com/golang/go/issues/20911). This isn't the correct behavior. If we switch to one of the Lookup* methods (LookupIP?), that should give us addresses in the order returned by the local resolver.

There are multiple places this is called, there's listen addresses to worry about, and whether or not this works with and without cgo, etc, so this may take some care to get right.