mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-13 17:19:22 +00:00
ipn, control/controlclient: fix some data races
More remain. Fixes tailscale/corp#432
This commit is contained in:
parent
de875a4d87
commit
a8b95571fb
@ -456,7 +456,7 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*NetworkM
|
|||||||
persist := c.persist
|
persist := c.persist
|
||||||
serverURL := c.serverURL
|
serverURL := c.serverURL
|
||||||
serverKey := c.serverKey
|
serverKey := c.serverKey
|
||||||
hostinfo := c.hostinfo
|
hostinfo := c.hostinfo.Clone()
|
||||||
backendLogID := hostinfo.BackendLogID
|
backendLogID := hostinfo.BackendLogID
|
||||||
localPort := c.localPort
|
localPort := c.localPort
|
||||||
ep := append([]string(nil), c.endpoints...)
|
ep := append([]string(nil), c.endpoints...)
|
||||||
|
@ -712,11 +712,12 @@ func (b *LocalBackend) SetPrefs(new *Prefs) {
|
|||||||
newHi.Hostname = h
|
newHi.Hostname = h
|
||||||
}
|
}
|
||||||
b.hostinfo = newHi
|
b.hostinfo = newHi
|
||||||
|
hostInfoChanged := !oldHi.Equal(newHi)
|
||||||
b.mu.Unlock()
|
b.mu.Unlock()
|
||||||
|
|
||||||
b.logf("SetPrefs: %v", new.Pretty())
|
b.logf("SetPrefs: %v", new.Pretty())
|
||||||
|
|
||||||
if old.ShieldsUp != new.ShieldsUp || !oldHi.Equal(newHi) {
|
if old.ShieldsUp != new.ShieldsUp || hostInfoChanged {
|
||||||
b.doSetHostinfoFilterServices(newHi)
|
b.doSetHostinfoFilterServices(newHi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user