ipn: call SetNetInfoCallback later, in Start

It was being called back into ultimately from magicsock before there
was a control client.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2020-03-23 22:16:16 -07:00 committed by Brad Fitzpatrick
parent 680311b3df
commit 7740cbd8d9
1 changed files with 2 additions and 2 deletions

View File

@ -87,8 +87,6 @@ func NewLocalBackend(logf logger.Logf, logid string, store StateStore, e wgengin
} }
b.statusChanged = sync.NewCond(&b.statusLock) b.statusChanged = sync.NewCond(&b.statusLock)
e.SetNetInfoCallback(b.SetNetInfo)
if b.portpoll != nil { if b.portpoll != nil {
go b.portpoll.Run(ctx) go b.portpoll.Run(ctx)
go b.runPoller() go b.runPoller()
@ -290,6 +288,8 @@ func (b *LocalBackend) Start(opts Options) error {
b.send(Notify{Engine: &es}) b.send(Notify{Engine: &es})
}) })
b.e.SetNetInfoCallback(b.SetNetInfo)
b.mu.Lock() b.mu.Lock()
prefs := b.prefs.Clone() prefs := b.prefs.Clone()
b.mu.Unlock() b.mu.Unlock()