diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-22 00:28:18 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-22 00:28:18 +0100 |
commit | 4ed646973ee4e1871cda792083bf4fe70afa8c3f (patch) | |
tree | 4f7df25ce19ada60ed792c729e562cb2b367a72b /WireGuard/WireGuard/Tunnel/TunnelsManager.swift | |
parent | Fix paren typo (diff) | |
download | wireguard-apple-4ed646973ee4e1871cda792083bf4fe70afa8c3f.tar.xz wireguard-apple-4ed646973ee4e1871cda792083bf4fe70afa8c3f.zip |
Move name from interface to tunnel
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | WireGuard/WireGuard/Tunnel/TunnelsManager.swift | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift index 8c7bbb3..bf5ab52 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift @@ -54,7 +54,7 @@ class TunnelsManager { } func add(tunnelConfiguration: TunnelConfiguration, activateOnDemandSetting: ActivateOnDemandSetting = ActivateOnDemandSetting.defaultSetting, completionHandler: @escaping (WireGuardResult<TunnelContainer>) -> Void) { - let tunnelName = tunnelConfiguration.interface.name ?? "" + let tunnelName = tunnelConfiguration.name ?? "" if tunnelName.isEmpty { completionHandler(.failure(TunnelsManagerError.tunnelNameEmpty)) return @@ -67,7 +67,7 @@ class TunnelsManager { let tunnelProviderManager = NETunnelProviderManager() tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration) - tunnelProviderManager.localizedDescription = tunnelConfiguration.interface.name + tunnelProviderManager.localizedDescription = tunnelConfiguration.name tunnelProviderManager.isEnabled = true activateOnDemandSetting.apply(on: tunnelProviderManager) @@ -107,7 +107,7 @@ class TunnelsManager { } func modify(tunnel: TunnelContainer, tunnelConfiguration: TunnelConfiguration, activateOnDemandSetting: ActivateOnDemandSetting, completionHandler: @escaping (TunnelsManagerError?) -> Void) { - let tunnelName = tunnelConfiguration.interface.name ?? "" + let tunnelName = tunnelConfiguration.name ?? "" if tunnelName.isEmpty { completionHandler(TunnelsManagerError.tunnelNameEmpty) return @@ -124,7 +124,7 @@ class TunnelsManager { } tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration) - tunnelProviderManager.localizedDescription = tunnelConfiguration.interface.name + tunnelProviderManager.localizedDescription = tunnelConfiguration.name tunnelProviderManager.isEnabled = true let isActivatingOnDemand = !tunnelProviderManager.isOnDemandEnabled && activateOnDemandSetting.isActivateOnDemandEnabled @@ -349,7 +349,7 @@ class TunnelContainer: NSObject { private var lastTunnelConnectionStatus: NEVPNStatus? var tunnelConfiguration: TunnelConfiguration? { - return (tunnelProvider.protocolConfiguration as? NETunnelProviderProtocol)?.tunnelConfiguration(name: tunnelProvider.localizedDescription) + return (tunnelProvider.protocolConfiguration as? NETunnelProviderProtocol)?.asTunnelConfiguration(called: tunnelProvider.localizedDescription) } var activateOnDemandSetting: ActivateOnDemandSetting { |