cmd/tailscale: avoid backend deadlocks from SetPrefs and LinkChange

Updates tailscale/tailscale#471 (perhaps fixes it)

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/3/head
Elias Naur 4 years ago
parent bae9b8394a
commit 2119f8aa9d

@ -187,7 +187,7 @@ func (a *App) runBackend() error {
prefs = p.Clone() prefs = p.Clone()
if first { if first {
prefs.Hostname = a.hostname() prefs.Hostname = a.hostname()
b.backend.SetPrefs(prefs) go b.backend.SetPrefs(prefs)
} }
a.setPrefs(prefs) a.setPrefs(prefs)
} }
@ -277,7 +277,7 @@ func (a *App) runBackend() error {
case <-onConnectivityChange: case <-onConnectivityChange:
state.LostInternet = !connected.Load().(bool) state.LostInternet = !connected.Load().(bool)
if b != nil { if b != nil {
b.LinkChange() go b.LinkChange()
} }
a.notify(state) a.notify(state)
case s := <-onDisconnect: case s := <-onDisconnect:

Loading…
Cancel
Save