WireGuardKitGo: update to latest wireguard-go tag

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2020-12-15 13:16:35 +01:00
parent 9d5b376dcf
commit 27b32e60b2
5 changed files with 48 additions and 38 deletions
+9 -7
View File
@@ -152,10 +152,6 @@ public class WireGuardAdapter {
return
}
#if os(macOS)
wgEnableRoaming(true)
#endif
let networkMonitor = NWPathMonitor()
networkMonitor.pathUpdateHandler = { [weak self] path in
self?.didReceivePathUpdate(path: path)
@@ -238,6 +234,9 @@ public class WireGuardAdapter {
self.logEndpointResolutionResults(resolutionResults)
wgSetConfig(handle, wgConfig)
#if os(iOS)
wgDisableSomeRoamingForBrokenMobileSemantics(handle)
#endif
self.state = .started(handle, settingsGenerator)
@@ -346,11 +345,13 @@ public class WireGuardAdapter {
}
let handle = wgTurnOn(wgConfig, tunnelFileDescriptor)
if handle >= 0 {
return handle
} else {
if handle < 0 {
throw WireGuardAdapterError.startWireGuardBackend(handle)
}
#if os(iOS)
wgDisableSomeRoamingForBrokenMobileSemantics(handle)
#endif
return handle
}
/// Resolves the hostnames in the given tunnel configuration and return settings generator.
@@ -398,6 +399,7 @@ public class WireGuardAdapter {
self.logEndpointResolutionResults(resolutionResults)
wgSetConfig(handle, wgConfig)
wgDisableSomeRoamingForBrokenMobileSemantics(handle)
wgBumpSockets(handle)
} else {
self.logHandler(.info, "Connectivity offline, pausing backend.")