ipn/ipnlocal: only fix peerapiListener on Windows when running

It's just logspam otherwise.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-04-20 08:41:25 -07:00
parent 36fa29feec
commit a58fbb4da9
1 changed files with 1 additions and 1 deletions

View File

@ -232,7 +232,7 @@ func (b *LocalBackend) linkChange(major bool, ifst *interfaces.State) {
// need updating to tweak default routes. // need updating to tweak default routes.
b.updateFilter(b.netMap, b.prefs) b.updateFilter(b.netMap, b.prefs)
if runtime.GOOS == "windows" && b.netMap != nil { if runtime.GOOS == "windows" && b.netMap != nil && b.state == ipn.Running {
want := len(b.netMap.Addresses) want := len(b.netMap.Addresses)
b.logf("linkChange: peerAPIListeners too low; trying again") b.logf("linkChange: peerAPIListeners too low; trying again")
if len(b.peerAPIListeners) < want { if len(b.peerAPIListeners) < want {