device: remove global for roaming escape hatch

Signed-off-by: Jason A. Donenfeld <[email protected]>
This commit is contained in:
Jason A. Donenfeld
2020-10-14 10:45:31 +02:00
parent 0cfa3314ee
commit c8fe925020
2 changed files with 18 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
/* SPDX-License-Identifier: MIT
*
* Copyright (C) 2020 WireGuard LLC. All Rights Reserved.
*/
package device
func (device *Device) DisableSomeRoamingForBrokenMobileSemantics() {
device.peers.RLock()
for _, peer := range device.peers.keyMap {
peer.Lock()
defer peer.Unlock()
peer.disableRoaming = peer.endpoint != nil
}
device.peers.RUnlock()
}