Skip DNS settings if no servers are provided
This commit is contained in:
parent
4ce2d78c5a
commit
82394e0433
|
@ -571,16 +571,19 @@ extension TunnelKitProvider: SessionProxyDelegate {
|
||||||
ipv6Settings?.includedRoutes = routes
|
ipv6Settings?.includedRoutes = routes
|
||||||
ipv6Settings?.excludedRoutes = []
|
ipv6Settings?.excludedRoutes = []
|
||||||
}
|
}
|
||||||
|
|
||||||
var dnsServers = cfg.sessionConfiguration.dnsServers
|
var dnsSettings: NEDNSSettings?
|
||||||
if dnsServers?.isEmpty ?? true {
|
var cfgDNSServers = cfg.sessionConfiguration.dnsServers
|
||||||
dnsServers = reply.options.dnsServers
|
if cfgDNSServers?.isEmpty ?? true {
|
||||||
|
cfgDNSServers = reply.options.dnsServers
|
||||||
}
|
}
|
||||||
// FIXME: default to DNS servers from current network instead
|
// FIXME: default to DNS servers from current network instead
|
||||||
let dnsSettings = NEDNSSettings(servers: dnsServers ?? [])
|
if let dnsServers = cfgDNSServers, !dnsServers.isEmpty {
|
||||||
if let searchDomain = cfg.sessionConfiguration.searchDomain ?? reply.options.searchDomain {
|
dnsSettings = NEDNSSettings(servers: dnsServers)
|
||||||
dnsSettings.domainName = searchDomain
|
if let searchDomain = cfg.sessionConfiguration.searchDomain ?? reply.options.searchDomain {
|
||||||
dnsSettings.searchDomains = [searchDomain]
|
dnsSettings?.domainName = searchDomain
|
||||||
|
dnsSettings?.searchDomains = [searchDomain]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var proxySettings: NEProxySettings?
|
var proxySettings: NEProxySettings?
|
||||||
|
|
Loading…
Reference in New Issue