diff options
-rw-r--r-- | device/device.go | 1 | ||||
-rw-r--r-- | device/mobilequirks.go | 3 | ||||
-rw-r--r-- | device/uapi.go | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/device/device.go b/device/device.go index 7717494..91654c6 100644 --- a/device/device.go +++ b/device/device.go @@ -44,6 +44,7 @@ type Device struct { netlinkCancel *rwcancel.RWCancel port uint16 // listening port fwmark uint32 // mark value (0 = disabled) + brokenRoaming bool } staticIdentity struct { diff --git a/device/mobilequirks.go b/device/mobilequirks.go index f27d9d7..680f5c7 100644 --- a/device/mobilequirks.go +++ b/device/mobilequirks.go @@ -5,7 +5,10 @@ package device +// DisableSomeRoamingForBrokenMobileSemantics should ideally be called before peers are created, +// though it will try to deal with it, and race maybe, if called after. func (device *Device) DisableSomeRoamingForBrokenMobileSemantics() { + device.net.brokenRoaming = true device.peers.RLock() for _, peer := range device.peers.keyMap { peer.Lock() diff --git a/device/uapi.go b/device/uapi.go index 019249d..e33355d 100644 --- a/device/uapi.go +++ b/device/uapi.go @@ -261,6 +261,7 @@ func (peer *ipcSetPeer) handlePostConfig() { if peer.Peer == nil { return } + peer.disableRoaming = peer.device.net.brokenRoaming && peer.endpoint != nil if !peer.dummy && peer.device.isUp() { peer.Start() if peer.pkaOn { |