Also refresh status

This commit is contained in:
Jason A. Donenfeld 2018-12-22 07:07:53 +01:00
parent 470da3ffcc
commit 08daec71aa
1 changed files with 4 additions and 1 deletions

View File

@ -283,7 +283,10 @@ class TunnelsManager {
let tunnelProvider = session.manager as? NETunnelProviderManager,
let tunnelConfiguration = TunnelContainer(tunnel: tunnelProvider).tunnelConfiguration,
let tunnel = self.tunnels.first(where: { $0.tunnelConfiguration == tunnelConfiguration }) else { return }
tunnel.tunnelProvider = tunnelProvider
if tunnel.tunnelProvider != tunnelProvider {
tunnel.tunnelProvider = tunnelProvider
tunnel.refreshStatus()
}
wg_log(.debug, message: "Tunnel '\(tunnel.name)' connection status changed to '\(tunnel.tunnelProvider.connection.status)'")