aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-25 22:38:32 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-26 01:17:55 +0100
commitc9c343cde21eab0b776c97e7017e7fd515b4ac4d (patch)
tree3e2efb04d430b2ee3d4407b33ef50b3327356c60 /WireGuard/WireGuardNetworkExtension/PacketTunnelSettingsGenerator.swift
parentminizip: Remove zip encryption code (diff)
downloadwireguard-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.swift8
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
}