tstest/integration/testcontrol: fix data race

Fix race from 1ec99e99f4

Fixes #3289

Change-Id: I58158d3f82339ac171fb14827c5f158d602327f4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/3303/head
Brad Fitzpatrick 3 years ago committed by Brad Fitzpatrick
parent 5b94f67956
commit f7da8c77bd

@ -157,10 +157,11 @@ func (s *Server) AddPingRequest(nodeKeyDst key.NodePublic, pr *tailcfg.PingReque
// Mark the Node key of every node as expired
func (s *Server) SetExpireAllNodes(expired bool) {
s.mu.Lock()
defer s.mu.Unlock()
s.allExpired = expired
s.mu.Unlock()
for _, node := range s.AllNodes() {
for _, node := range s.nodes {
sendUpdate(s.updates[node.ID], updateSelfChanged)
}
}

Loading…
Cancel
Save