github.com/koomox/wireguard-go@v0.0.0-20230722134753-17a50b2f22a3/device/mobilequirks.go (about) 1 /* SPDX-License-Identifier: MIT 2 * 3 * Copyright (C) 2017-2023 WireGuard LLC. All Rights Reserved. 4 */ 5 6 package device 7 8 // DisableSomeRoamingForBrokenMobileSemantics should ideally be called before peers are created, 9 // though it will try to deal with it, and race maybe, if called after. 10 func (device *Device) DisableSomeRoamingForBrokenMobileSemantics() { 11 device.net.brokenRoaming = true 12 device.peers.RLock() 13 for _, peer := range device.peers.keyMap { 14 peer.Lock() 15 peer.disableRoaming = peer.endpoint != nil 16 peer.Unlock() 17 } 18 device.peers.RUnlock() 19 }