net/netcheck: use dnscache.Resolver when resolving DERP IPs

This also adds a bunch of tests for this function to ensure that we're
returning the proper IP(s) in all cases.

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I0d9d57170dbab5f2bf07abdf78ecd17e0e635399
This commit is contained in:
Andrew Dunham
2023-04-14 12:13:03 -04:00
parent 64bbf1738e
commit 228d0c6aea
4 changed files with 110 additions and 5 deletions

View File

@@ -660,6 +660,7 @@ func NewConn(opts Options) (*Conn, error) {
GetSTUNConn6: func() netcheck.STUNConn { return &c.pconn6 },
SkipExternalNetwork: inTest(),
PortMapper: c.portMapper,
UseDNSCache: true,
}
c.ignoreSTUNPackets()