gitee.com/aurawing/surguard-go@v0.3.1-0.20240409071558-96509a61ecf3/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.endpoint.Lock() 15 peer.endpoint.disableRoaming = peer.endpoint.val != nil 16 peer.endpoint.Unlock() 17 } 18 device.peers.RUnlock() 19 }