ipnlocal: don't pause the controlclient until we get at least one netmap.

Without this, macOS would fail to display its menu state correctly if you
started it while !WantRunning. It relies on the netmap in order to show
the logged-in username.

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
Avery Pennarun
2021-04-30 06:08:26 -04:00
parent 4ef207833b
commit 0181a4d0ac
3 changed files with 10 additions and 4 deletions

View File

@@ -234,7 +234,7 @@ func (b *LocalBackend) linkChange(major bool, ifst *interfaces.State) {
networkUp := ifst.AnyInterfaceUp()
if b.cc != nil {
go b.cc.SetPaused(b.state == ipn.Stopped || !networkUp)
go b.cc.SetPaused((b.state == ipn.Stopped && b.netMap != nil) || !networkUp)
}
// If the PAC-ness of the network changed, reconfig wireguard+route to
@@ -2067,6 +2067,7 @@ func (b *LocalBackend) enterState(newState ipn.State) {
b.state = newState
prefs := b.prefs
cc := b.cc
netMap := b.netMap
networkUp := b.prevIfState.AnyInterfaceUp()
activeLogin := b.activeLogin
authURL := b.authURL
@@ -2088,7 +2089,7 @@ func (b *LocalBackend) enterState(newState ipn.State) {
b.send(ipn.Notify{State: &newState})
if cc != nil {
cc.SetPaused(newState == ipn.Stopped || !networkUp)
cc.SetPaused((newState == ipn.Stopped && netMap != nil) || !networkUp)
}
switch newState {