Use config key for DNS config setting.

This commit is contained in:
Jeroen Leenarts 2018-08-13 13:48:43 +02:00
parent 8e521b2b8f
commit 013a75eda6
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
let newSettings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "149.248.160.60")
newSettings.ipv4Settings = ipv4Settings
newSettings.tunnelOverheadBytes = 80
if let dns = config.providerConfiguration?["dns"] as? String {
if let dns = config.providerConfiguration?[PCKeys.dns.rawValue] as? String {
var splitDnsEntries = dns.split(separator: ",").map {String($0)}
let dnsSettings = NEDNSSettings(servers: splitDnsEntries)
newSettings.dnsSettings = dnsSettings