diff options
author | Roopesh Chander <roop@roopc.net> | 2018-12-19 15:38:00 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2018-12-19 15:38:00 +0530 |
commit | fa51e3f1d1636374341b7bf07967626af9e97b91 (patch) | |
tree | d12d7c0e6599ef37ea5d405e99d2f4dac77f8397 /WireGuard/WireGuard/Tunnel | |
parent | NE: No need for two startTunnel() methods (diff) | |
download | wireguard-apple-fa51e3f1d1636374341b7bf07967626af9e97b91.tar.xz wireguard-apple-fa51e3f1d1636374341b7bf07967626af9e97b91.zip |
NE: Handle bad domain names and Activate On Demand
This combination causes iOS to keep trying to bring up the tunnel,
leading to a lot of displayMessage() alerts.
In this fix, if we get a DNS resolution error in an Activate On Demand
enabled tunnel, we silently retry 9 times (with a 4-second delay before
each retry) and then show the displayMessage() alert.
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/Tunnel')
-rw-r--r-- | WireGuard/WireGuard/Tunnel/TunnelsManager.swift | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift index 26e134f..10ef1ef 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift @@ -59,7 +59,7 @@ class TunnelsManager { } let tunnelProviderManager = NETunnelProviderManager() - tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration) + tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration, isActivateOnDemandEnabled: activateOnDemandSetting.isActivateOnDemandEnabled) tunnelProviderManager.localizedDescription = tunnelName tunnelProviderManager.isEnabled = true @@ -115,7 +115,7 @@ class TunnelsManager { } tunnel.name = tunnelName } - tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration) + tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration, isActivateOnDemandEnabled: activateOnDemandSetting.isActivateOnDemandEnabled) tunnelProviderManager.localizedDescription = tunnelName tunnelProviderManager.isEnabled = true |