ipn, wgengine/magicsock: be more idle when in Stopped state with no peers

(Previously as #288, but with some more.)

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-04-28 13:41:18 -07:00
parent 66c7875974
commit 18017f7630
2 changed files with 18 additions and 1 deletions
+4
View File
@@ -698,6 +698,7 @@ func (b *LocalBackend) enterState(newState State) {
state := b.state
prefs := b.prefs
notify := b.notify
c := b.c
b.mu.Unlock()
if state == newState {
@@ -719,6 +720,9 @@ func (b *LocalBackend) enterState(newState State) {
if err != nil {
b.logf("Reconfig(down): %v", err)
}
if c != nil {
c.Shutdown()
}
case Starting, NeedsMachineAuth:
b.authReconfig()
// Needed so that UpdateEndpoints can run