tailscale/net/dns/resolver
Nick Hill c2144c44a3 net/dns/resolver: update (*forwarder).forwardWithDestChan to always return an error unless it sends a response to responseChan
We currently have two executions paths where (*forwarder).forwardWithDestChan
returns nil, rather than an error, without sending a DNS response to responseChan.

These paths are accompanied by a comment that reads:
// Returning an error will cause an internal retry, there is
// nothing we can do if parsing failed. Just drop the packet.
But it is not (or no longer longer) accurate: returning an error from forwardWithDestChan
does not currently cause a retry.

Moreover, although these paths are currently unreachable due to implementation details,
if (*forwarder).forwardWithDestChan were to return nil without sending a response to
responseChan, it would cause a deadlock at one call site and a panic at another.

Therefore, we update (*forwarder).forwardWithDestChan to return errors in those two paths
and remove comments that were no longer accurate and misleading.

Updates #cleanup
Updates #13571

Signed-off-by: Nick Hill <mykola.khyl@gmail.com>
2024-10-11 12:02:27 -05:00
..
debug.go all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
doh_test.go net/dns/resolver: remove maxDoHInFlight 2023-02-03 17:07:12 -08:00
forwarder_test.go net/dns/resolver: update (*forwarder).forwardWithDestChan to always return an error unless it sends a response to responseChan 2024-10-11 12:02:27 -05:00
forwarder.go net/dns/resolver: update (*forwarder).forwardWithDestChan to always return an error unless it sends a response to responseChan 2024-10-11 12:02:27 -05:00
macios_ext.go all: avoid repeated default interface lookups 2023-04-20 15:46:01 -07:00
tsdns_server_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
tsdns_test.go net/dns/resolver: update (*forwarder).forwardWithDestChan to always return an error unless it sends a response to responseChan 2024-10-11 12:02:27 -05:00
tsdns.go net/dns/resolver: forward SERVFAIL responses over PeerDNS 2024-10-11 12:02:27 -05:00