tailscale/net/dns
Andrew Dunham 286c6ce27c
net/dns/resolver: race UDP and TCP queries (#9544)
Instead of just falling back to making a TCP query to an upstream DNS
server when the UDP query returns a truncated query, also start a TCP
query in parallel with the UDP query after a given race timeout. This
ensures that if the upstream DNS server does not reply over UDP (or if
the response packet is blocked, or there's an error), we can still make
queries if the server replies to TCP queries.

This also adds a new package, util/race, to contain the logic required for
racing two different functions and returning the first non-error answer.

Updates tailscale/corp#14809

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I4311702016c1093b1beaa31b135da1def6d86316
2023-10-03 16:26:38 -04:00
..
publicdns net/dns/publicdns: update Quad9 addresses and references 2023-09-20 16:55:58 -07:00
recursive all: use Go 1.21 slices, maps instead of x/exp/{slices,maps} 2023-08-17 08:42:35 -07:00
resolvconffile all: update to Go 1.20, use strings.CutPrefix/Suffix instead of our fork 2023-02-01 15:23:54 -08:00
resolver net/dns/resolver: race UDP and TCP queries (#9544) 2023-10-03 16:26:38 -04:00
config.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
debian_resolvconf.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
direct_linux.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
direct_notlinux.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
direct_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
direct.go net/dns: overwrite /tmp/resolv.conf on gokrazy 2023-07-23 09:53:32 -07:00
flush_default.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
flush_windows.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
ini_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
ini.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
manager_darwin.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
manager_default.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
manager_freebsd.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
manager_linux_test.go net/dns: detect when libnss_resolve is used 2023-07-20 18:26:23 +02:00
manager_linux.go net/dns: detect when libnss_resolve is used 2023-07-20 18:26:23 +02:00
manager_openbsd.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
manager_tcp_test.go net/dns: retry forwarder requests over TCP 2023-09-25 16:42:07 -04:00
manager_test.go net/dns: retry forwarder requests over TCP 2023-09-25 16:42:07 -04:00
manager_windows_test.go various: add golangci-lint, fix issues (#7905) 2023-04-17 18:38:24 -04:00
manager_windows.go net/dns: deal with Windows wsl.exe hangs 2023-03-06 16:08:13 -07:00
manager.go net/dns: retry forwarder requests over TCP 2023-09-25 16:42:07 -04:00
nm.go net/{interfaces,netmon}: remove "interesting", EqualFiltered API 2023-08-29 11:57:30 -07:00
noop.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
nrpt_windows.go all: use set.Set consistently instead of map[T]struct{} 2023-09-09 10:59:19 -07:00
openresolv.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
osconfig_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
osconfig.go wgengine/magicsock, controlclient, net/dns: reduce some logspam 2023-09-23 11:52:47 -07:00
resolvconf-workaround.sh all: update copyright and license headers 2023-01-27 15:36:29 -08:00
resolvconf.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
resolvconfpath_default.go net/dns: overwrite /tmp/resolv.conf on gokrazy 2023-07-23 09:53:32 -07:00
resolvconfpath_gokrazy.go net/dns: overwrite /tmp/resolv.conf on gokrazy 2023-07-23 09:53:32 -07:00
resolvd.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
resolved.go net/dns: don't send on closed channel in resolvedManager 2023-03-24 15:34:54 -04:00
utf_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
utf.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
wsl_windows.go net/dns: deal with Windows wsl.exe hangs 2023-03-06 16:08:13 -07:00