aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/ViewController
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-02-21 18:17:23 +0530
committerRoopesh Chander <roop@roopc.net>2019-02-21 18:17:28 +0530
commit39fb52a2e3844af59182999c7ed49d99814cbb63 (patch)
tree17d19391f59cc5db553a6740477f197f440d6bfa /WireGuard/WireGuard/UI/macOS/ViewController
parentiOS: On changing DNS, update AllowedIPs with the current DNS servers (diff)
downloadwireguard-apple-39fb52a2e3844af59182999c7ed49d99814cbb63.tar.xz
wireguard-apple-39fb52a2e3844af59182999c7ed49d99814cbb63.zip
macOS: Fix removal of DNSes from AllowedIPs when DNS has changed
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/ViewController')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift2
1 files changed, 1 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
index 526dbc65..2e3bceff 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift
@@ -290,7 +290,7 @@ class TunnelEditViewController: NSViewController {
guard let tunnelConfiguration = try? TunnelConfiguration(fromWgQuickConfig: textView.string, called: nameRow.value) else { return }
let isOn = excludePrivateIPsCheckbox.state == .on
let tunnelViewModel = TunnelViewModel(tunnelConfiguration: tunnelConfiguration)
- tunnelViewModel.peersData.first?.excludePrivateIPsValueChanged(isOn: isOn, dnsServers: tunnelViewModel.interfaceData[.dns])
+ tunnelViewModel.peersData.first?.excludePrivateIPsValueChanged(isOn: isOn, dnsServers: tunnelViewModel.interfaceData[.dns], oldDNSServers: dnsServersAddedToAllowedIPs)
if let modifiedConfig = tunnelViewModel.asWgQuickConfig() {
textView.setConfText(modifiedConfig)
dnsServersAddedToAllowedIPs = isOn ? tunnelViewModel.interfaceData[.dns] : nil