tstest/integration/testcontrol: fix data race

Fix race from 1ec99e99f4

Fixes #3289

Change-Id: I58158d3f82339ac171fb14827c5f158d602327f4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-11-11 08:12:45 -08:00 committed by Brad Fitzpatrick
parent 5b94f67956
commit f7da8c77bd

View File

@ -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()
s.allExpired = expired
s.mu.Unlock()
defer s.mu.Unlock()
for _, node := range s.AllNodes() {
s.allExpired = expired
for _, node := range s.nodes {
sendUpdate(s.updates[node.ID], updateSelfChanged)
}
}