mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-21 22:21:41 +00:00
net/dns: don't send on closed channel in resolvedManager
Fixes #7686 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: Ibffb05539ab876b12407d77dcf2201d467895981
This commit is contained in:
parent
6f9aed1656
commit
33b359642e
@ -117,8 +117,10 @@ func newResolvedManager(logf logger.Logf, interfaceName string) (*resolvedManage
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *resolvedManager) SetDNS(config OSConfig) error {
|
func (m *resolvedManager) SetDNS(config OSConfig) error {
|
||||||
|
// NOTE: don't close this channel, since it's possible that the SetDNS
|
||||||
|
// call will time out and return before the run loop answers, at which
|
||||||
|
// point it will send on the now-closed channel.
|
||||||
errc := make(chan error, 1)
|
errc := make(chan error, 1)
|
||||||
defer close(errc)
|
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-m.ctx.Done():
|
case <-m.ctx.Done():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user