diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-25 22:38:32 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-26 01:17:55 +0100 |
commit | c9c343cde21eab0b776c97e7017e7fd515b4ac4d (patch) | |
tree | 3e2efb04d430b2ee3d4407b33ef50b3327356c60 /WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift | |
parent | minizip: Remove zip encryption code (diff) | |
download | wireguard-apple-c9c343cde21eab0b776c97e7017e7fd515b4ac4d.tar.xz wireguard-apple-c9c343cde21eab0b776c97e7017e7fd515b4ac4d.zip |
NetworkExtension: rescope socket instead of tearing down socket
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift')
-rw-r--r-- | WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift b/WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift index 462d110..5946843 100644 --- a/WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift +++ b/WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift @@ -14,13 +14,8 @@ class PacketTunnelSettingsGenerator { self.resolvedEndpoints = resolvedEndpoints } - func endpointUapiConfiguration(currentListenPort: UInt16?) -> String { + func endpointUapiConfiguration() -> String { var wgSettings = "" - - if let currentListenPort = currentListenPort { - wgSettings.append("listen_port=\(tunnelConfiguration.interface.listenPort ?? currentListenPort)\n") - } - for (index, peer) in tunnelConfiguration.peers.enumerated() { wgSettings.append("public_key=\(peer.publicKey.hexEncodedString())\n") if let endpoint = resolvedEndpoints[index] { @@ -28,7 +23,6 @@ class PacketTunnelSettingsGenerator { wgSettings.append("endpoint=\(endpoint.stringRepresentation)\n") } } - return wgSettings } |