mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-16 18:08:40 +00:00
ipn/ipnlocal: mark findExitNodeID as requiring mutex.
Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
parent
54d7070121
commit
8ee1cb6156
@ -310,7 +310,7 @@ func (b *LocalBackend) setClientStatus(st controlclient.Status) {
|
|||||||
prefsChanged = true
|
prefsChanged = true
|
||||||
}
|
}
|
||||||
if st.NetMap != nil {
|
if st.NetMap != nil {
|
||||||
if b.findExitNodeID(st.NetMap) {
|
if b.findExitNodeIDLocked(st.NetMap) {
|
||||||
prefsChanged = true
|
prefsChanged = true
|
||||||
}
|
}
|
||||||
b.setNetMapLocked(st.NetMap)
|
b.setNetMapLocked(st.NetMap)
|
||||||
@ -371,9 +371,9 @@ func (b *LocalBackend) setClientStatus(st controlclient.Status) {
|
|||||||
b.authReconfig()
|
b.authReconfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
// findExitNodeID updates b.prefs to reference an exit node by ID,
|
// findExitNodeIDLocked updates b.prefs to reference an exit node by ID,
|
||||||
// rather than by IP. It returns whether prefs was mutated.
|
// rather than by IP. It returns whether prefs was mutated.
|
||||||
func (b *LocalBackend) findExitNodeID(nm *netmap.NetworkMap) (prefsChanged bool) {
|
func (b *LocalBackend) findExitNodeIDLocked(nm *netmap.NetworkMap) (prefsChanged bool) {
|
||||||
// If we have a desired IP on file, try to find the corresponding
|
// If we have a desired IP on file, try to find the corresponding
|
||||||
// node.
|
// node.
|
||||||
if b.prefs.ExitNodeIP.IsZero() {
|
if b.prefs.ExitNodeIP.IsZero() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user