mirror of
https://github.com/slackhq/nebula.git
synced 2026-06-30 18:40:29 +02:00
fix a race in RelayState.CopyRelayIps (#1753)
This commit is contained in:
+1
-1
@@ -138,9 +138,9 @@ func (rs *RelayState) InsertRelayTo(ip netip.Addr) {
|
||||
}
|
||||
|
||||
func (rs *RelayState) CopyRelayIps() []netip.Addr {
|
||||
ret := make([]netip.Addr, len(rs.relays))
|
||||
rs.RLock()
|
||||
defer rs.RUnlock()
|
||||
ret := make([]netip.Addr, len(rs.relays))
|
||||
copy(ret, rs.relays)
|
||||
return ret
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user