diff options
| author | Nick Hill <mykola.khyl@gmail.com> | 2024-10-04 15:11:46 -0500 |
|---|---|---|
| committer | Nick Khyl <1761190+nickkhyl@users.noreply.github.com> | 2024-10-11 12:02:27 -0500 |
| commit | c2144c44a33a373174624ede9f4f6ffe8334cf05 (patch) | |
| tree | af9e1969b918a59944409d5a06b6b1130579ab52 /control/controlhttp/controlhttpserver | |
| parent | e7545f2eac48ae9f35ba4a080d6e0b6ecfd054a4 (diff) | |
| download | tailscale-c2144c44a33a373174624ede9f4f6ffe8334cf05.tar.xz tailscale-c2144c44a33a373174624ede9f4f6ffe8334cf05.zip | |
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>
Diffstat (limited to 'control/controlhttp/controlhttpserver')
0 files changed, 0 insertions, 0 deletions
