From 7cee9608d9de31321d7c89d645494c92eb35647a Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Sat, 9 Feb 2019 19:07:17 +0530 Subject: [PATCH] TunnelsManager: No need to access tunnelConfiguration on status change --- WireGuard/WireGuard/Tunnel/TunnelsManager.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift index 8718ccf..fbfd81a 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift @@ -313,11 +313,7 @@ class TunnelsManager { guard let self = self, let session = statusChangeNotification.object as? NETunnelProviderSession, let tunnelProvider = session.manager as? NETunnelProviderManager, - let tunnelConfiguration = tunnelProvider.tunnelConfiguration, - let tunnel = self.tunnels.first(where: { $0.tunnelConfiguration == tunnelConfiguration }) else { return } - if tunnel.tunnelProvider != tunnelProvider { - return - } + let tunnel = self.tunnels.first(where: { $0.tunnelProvider == tunnelProvider }) else { return } wg_log(.debug, message: "Tunnel '\(tunnel.name)' connection status changed to '\(tunnel.tunnelProvider.connection.status)'")