mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-21 22:21:41 +00:00
magicsock: work around race condition initializing .Regions[].
Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
This commit is contained in:
parent
7cd9ff3dde
commit
30e5c19214
@ -487,7 +487,12 @@ func (c *Conn) setNearestDERP(derpNum int) (wantDERP bool) {
|
|||||||
|
|
||||||
// On change, notify all currently connected DERP servers and
|
// On change, notify all currently connected DERP servers and
|
||||||
// start connecting to our home DERP if we are not already.
|
// start connecting to our home DERP if we are not already.
|
||||||
|
dr := c.derpMap.Regions[derpNum]
|
||||||
|
if dr == nil {
|
||||||
|
c.logf("[unexpected] magicsock: derpMap.Regions[%v] is nil", derpNum)
|
||||||
|
} else {
|
||||||
c.logf("magicsock: home is now derp-%v (%v)", derpNum, c.derpMap.Regions[derpNum].RegionCode)
|
c.logf("magicsock: home is now derp-%v (%v)", derpNum, c.derpMap.Regions[derpNum].RegionCode)
|
||||||
|
}
|
||||||
for i, ad := range c.activeDerp {
|
for i, ad := range c.activeDerp {
|
||||||
go ad.c.NotePreferred(i == c.myDerp)
|
go ad.c.NotePreferred(i == c.myDerp)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user