Only override domain if non-nil

This commit is contained in:
Davide De Rosa 2019-04-17 00:45:08 +02:00
parent 28fd80f4e0
commit b199064b94
1 changed files with 2 additions and 3 deletions

View File

@ -564,10 +564,9 @@ extension TunnelKitProvider: SessionProxyDelegate {
if dnsServers?.isEmpty ?? true {
dnsServers = reply.options.dnsServers
}
let searchDomain = cfg.sessionConfiguration.searchDomain ?? reply.options.searchDomain
let dnsSettings = NEDNSSettings(servers: dnsServers ?? [])
dnsSettings.domainName = searchDomain
if let searchDomain = searchDomain {
if let searchDomain = cfg.sessionConfiguration.searchDomain ?? reply.options.searchDomain {
dnsSettings.domainName = searchDomain
dnsSettings.searchDomains = [searchDomain]
}