]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
TunnelsManager: do not change back to inactive if we are resolving the endpoint
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 3 Nov 2018 05:09:07 +0000 (06:09 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sat, 3 Nov 2018 05:09:57 +0000 (06:09 +0100)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
WireGuard/WireGuard/VPN/TunnelsManager.swift

index 925b5ced177c26b817dd4761596bfb74f29ba747..eb69ccdf08004107aa95f0829bc39c55555f9251 100644 (file)
@@ -48,6 +48,7 @@ class TunnelsManager {
         for tunnel in tunnels {
             if (tunnel.status != .inactive) {
                 currentTunnel = tunnel
+                break
             }
         }
         self.tunnels = tunnels
@@ -439,6 +440,10 @@ class TunnelContainer: NSObject {
                     }
                     return
                 }
+                if (s.status == .resolvingEndpointDomains && connection.status == .disconnected) {
+                    // Don't change to .inactive if we're still resolving endpoints
+                    return
+                }
                 s.status = TunnelStatus(from: connection.status)
                 if (s.status == .inactive) {
                     s.stopObservingTunnelStatus()