mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 16:17:41 +00:00
copy callbacks into slice since maps aren't copied by value
Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
parent
2ca3005d02
commit
8521d66e2c
@ -1312,7 +1312,10 @@ func (e *userspaceEngine) SetDERPMap(dm *tailcfg.DERPMap) {
|
||||
func (e *userspaceEngine) SetNetworkMap(nm *controlclient.NetworkMap) {
|
||||
e.magicConn.SetNetworkMap(nm)
|
||||
e.mu.Lock()
|
||||
callbacks := e.networkMapCallbacks
|
||||
callbacks := make([]NetworkMapCallback, 0, 4)
|
||||
for _, fn := range e.networkMapCallbacks {
|
||||
callbacks = append(callbacks, fn)
|
||||
}
|
||||
e.mu.Unlock()
|
||||
for _, fn := range callbacks {
|
||||
fn(nm)
|
||||
|
Loading…
x
Reference in New Issue
Block a user