aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/VPN
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-10-25 06:58:14 +0530
committerRoopesh Chander <roop@roopc.net>2018-10-27 15:13:02 +0530
commit11876574979e42b18824f65cc64522431bcd4f1d (patch)
tree342e53e7884beb7fb24ca7f94494e6713fbcf36e /WireGuard/WireGuard/VPN
parentInfo.plist: support for opening wg-quick config (.conf) files (diff)
downloadwireguard-apple-11876574979e42b18824f65cc64522431bcd4f1d.tar.xz
wireguard-apple-11876574979e42b18824f65cc64522431bcd4f1d.zip
Model: Allow creating an interface with empty name
But don't allow such a tunnel to be added to the tunnel manager. (We'll need to create an interface with an empty name when we're reading QR codes.) Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/VPN')
-rw-r--r--WireGuard/WireGuard/VPN/TunnelsManager.swift1
1 files changed, 1 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/VPN/TunnelsManager.swift b/WireGuard/WireGuard/VPN/TunnelsManager.swift
index 9552c42..48b2767 100644
--- a/WireGuard/WireGuard/VPN/TunnelsManager.swift
+++ b/WireGuard/WireGuard/VPN/TunnelsManager.swift
@@ -53,6 +53,7 @@ class TunnelsManager {
}
func add(tunnelConfiguration: TunnelConfiguration, completionHandler: @escaping (TunnelContainer, Error?) -> Void) {
+ assert(!tunnelConfiguration.interface.name.isEmpty)
let tunnelProvider = TunnelProviderManager(tunnelConfiguration: tunnelConfiguration)
for tunnel in tunnels {
tunnel.index = tunnel.index + 1