diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-25 13:48:51 +0200 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2019-05-26 00:12:47 +0530 |
commit | 813dea69026c2853425513f776a9a7d5eb8676ce (patch) | |
tree | 52f8551fd337cf7c68cf6513a2e7337102714cdd /WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift | |
parent | iOS: Should be able to call showTunnelDetail multiple times (diff) | |
download | wireguard-apple-813dea69026c2853425513f776a9a7d5eb8676ce.tar.xz wireguard-apple-813dea69026c2853425513f776a9a7d5eb8676ce.zip |
NetworkExtension: use excludedRoutes instead of binding on iOS
The networking stack there is to flaky and the notifier doesn't always
fire correctly. Hopefully excludedRoutes works well with XLAT; otherwise
we're in trouble.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift')
-rw-r--r-- | WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift index c4fefd4..9aa466f 100644 --- a/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift +++ b/WireGuard/WireGuardNetworkExtension/PacketTunnelProvider.swift @@ -147,7 +147,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider { if let packetTunnelSettingsGenerator = packetTunnelSettingsGenerator { _ = packetTunnelSettingsGenerator.endpointUapiConfiguration().withGoString { return wgSetConfig(handle, $0) } } - #endif + #elseif os(macOS) var interfaces = path.availableInterfaces if let ifname = ifname { interfaces = interfaces.filter { $0.name != ifname } @@ -155,6 +155,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider { if let ifscope = interfaces.first?.index { wgBindInterfaceScope(handle, Int32(ifscope)) } + #endif } } |