Also refresh status

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-12-22 07:07:53 +01:00
parent 49bf55021f
commit 56ad5f74e9
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)'")