aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/Tunnel
diff options
context:
space:
mode:
authorEric Kuck <eric@bluelinelabs.com>2018-12-21 18:35:01 -0600
committerEric Kuck <eric@bluelinelabs.com>2018-12-21 18:35:01 -0600
commit1eeed89174c8d2cf06e132f7a56c89029d1c342c (patch)
treed0dd00ec040b1a33c90730533aedafc5d8521299 /WireGuard/WireGuard/Tunnel
parentDo not set copyable back to true on reuse (diff)
downloadwireguard-apple-1eeed89174c8d2cf06e132f7a56c89029d1c342c.tar.xz
wireguard-apple-1eeed89174c8d2cf06e132f7a56c89029d1c342c.zip
Fixes mock tunnels
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to 'WireGuard/WireGuard/Tunnel')
-rw-r--r--WireGuard/WireGuard/Tunnel/MockTunnels.swift6
1 files changed, 3 insertions, 3 deletions
diff --git a/WireGuard/WireGuard/Tunnel/MockTunnels.swift b/WireGuard/WireGuard/Tunnel/MockTunnels.swift
index 97ceacb7..746f508e 100644
--- a/WireGuard/WireGuard/Tunnel/MockTunnels.swift
+++ b/WireGuard/WireGuard/Tunnel/MockTunnels.swift
@@ -26,7 +26,7 @@ class MockTunnels {
static func createMockTunnels() -> [NETunnelProviderManager] {
return tunnelNames.map { tunnelName -> NETunnelProviderManager in
- var interface = InterfaceConfiguration(name: tunnelName, privateKey: Curve25519.generatePrivateKey())
+ var interface = InterfaceConfiguration(privateKey: Curve25519.generatePrivateKey())
interface.addresses = [IPAddressRange(from: String(format: address, Int.random(in: 1 ... 10), Int.random(in: 1 ... 254)))!]
interface.dns = dnsServers.map { DNSServer(from: $0)! }
@@ -34,11 +34,11 @@ class MockTunnels {
peer.endpoint = Endpoint(from: endpoint)
peer.allowedIPs = [IPAddressRange(from: allowedIPs)!]
- let tunnelConfiguration = TunnelConfiguration(interface: interface, peers: [peer])
+ let tunnelConfiguration = TunnelConfiguration(name: tunnelName, interface: interface, peers: [peer])
let tunnelProviderManager = NETunnelProviderManager()
tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration)
- tunnelProviderManager.localizedDescription = tunnelConfiguration.interface.name
+ tunnelProviderManager.localizedDescription = tunnelConfiguration.name
tunnelProviderManager.isEnabled = true
return tunnelProviderManager