2020-10-07 10:17:48 +02:00
|
|
|
/* SPDX-License-Identifier: MIT
|
|
|
|
*
|
2022-09-20 17:21:32 +02:00
|
|
|
* Copyright (C) 2017-2023 WireGuard LLC. All Rights Reserved.
|
2020-10-07 10:17:48 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
package device
|
|
|
|
|
2021-11-11 03:13:20 +01:00
|
|
|
// DisableSomeRoamingForBrokenMobileSemantics should ideally be called before peers are created,
|
|
|
|
// though it will try to deal with it, and race maybe, if called after.
|
2020-10-07 10:17:48 +02:00
|
|
|
func (device *Device) DisableSomeRoamingForBrokenMobileSemantics() {
|
2021-11-11 03:13:20 +01:00
|
|
|
device.net.brokenRoaming = true
|
2020-10-07 10:17:48 +02:00
|
|
|
device.peers.RLock()
|
|
|
|
for _, peer := range device.peers.keyMap {
|
2023-11-21 01:49:06 +01:00
|
|
|
peer.endpoint.Lock()
|
|
|
|
peer.endpoint.disableRoaming = peer.endpoint.val != nil
|
|
|
|
peer.endpoint.Unlock()
|
2020-10-07 10:17:48 +02:00
|
|
|
}
|
|
|
|
device.peers.RUnlock()
|
2020-11-06 18:01:09 +01:00
|
|
|
}
|