mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-22 08:51:41 +00:00
ipn: always guard LocalBackend.engineStatus with mu
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
parent
e7cdc11654
commit
3425d8d84f
@ -47,7 +47,7 @@ type LocalBackend struct {
|
|||||||
state State
|
state State
|
||||||
hiCache *tailcfg.Hostinfo
|
hiCache *tailcfg.Hostinfo
|
||||||
netMapCache *controlclient.NetworkMap
|
netMapCache *controlclient.NetworkMap
|
||||||
engineStatus EngineStatus // TODO: many uses without holding mu
|
engineStatus EngineStatus
|
||||||
endPoints []string // TODO: many uses without holding mu
|
endPoints []string // TODO: many uses without holding mu
|
||||||
blocked bool
|
blocked bool
|
||||||
authURL string
|
authURL string
|
||||||
@ -265,9 +265,8 @@ func (b *LocalBackend) Start(opts Options) error {
|
|||||||
b.mu.Lock() // why does this hold b.mu? parseWgStatus only reads b.logf
|
b.mu.Lock() // why does this hold b.mu? parseWgStatus only reads b.logf
|
||||||
es := b.parseWgStatus(s)
|
es := b.parseWgStatus(s)
|
||||||
c := b.c
|
c := b.c
|
||||||
b.mu.Unlock()
|
|
||||||
|
|
||||||
b.engineStatus = es
|
b.engineStatus = es
|
||||||
|
b.mu.Unlock()
|
||||||
|
|
||||||
if c != nil {
|
if c != nil {
|
||||||
c.UpdateEndpoints(0, s.LocalAddrs)
|
c.UpdateEndpoints(0, s.LocalAddrs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user