Merge pull request #85 from keeshux/dns-inconsistency-issues
DNS inconsistency issues
This commit is contained in:
commit
0c3a4235aa
|
@ -560,11 +560,14 @@ extension TunnelKitProvider: SessionProxyDelegate {
|
||||||
ipv6Settings?.excludedRoutes = []
|
ipv6Settings?.excludedRoutes = []
|
||||||
}
|
}
|
||||||
|
|
||||||
let dnsServers = cfg.sessionConfiguration.dnsServers ?? reply.options.dnsServers
|
var dnsServers = cfg.sessionConfiguration.dnsServers
|
||||||
let searchDomain = cfg.sessionConfiguration.searchDomain ?? reply.options.searchDomain
|
if dnsServers?.isEmpty ?? true {
|
||||||
|
dnsServers = reply.options.dnsServers
|
||||||
|
}
|
||||||
|
// FIXME: default to DNS servers from current network instead
|
||||||
let dnsSettings = NEDNSSettings(servers: dnsServers ?? [])
|
let dnsSettings = NEDNSSettings(servers: dnsServers ?? [])
|
||||||
dnsSettings.domainName = searchDomain
|
if let searchDomain = cfg.sessionConfiguration.searchDomain ?? reply.options.searchDomain {
|
||||||
if let searchDomain = searchDomain {
|
dnsSettings.domainName = searchDomain
|
||||||
dnsSettings.searchDomains = [searchDomain]
|
dnsSettings.searchDomains = [searchDomain]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ public class ConfigurationParser {
|
||||||
var optGateway4Arguments: [String]?
|
var optGateway4Arguments: [String]?
|
||||||
var optRoutes4: [(String, String, String?)] = [] // address, netmask, gateway
|
var optRoutes4: [(String, String, String?)] = [] // address, netmask, gateway
|
||||||
var optRoutes6: [(String, UInt8, String?)] = [] // destination, prefix, gateway
|
var optRoutes6: [(String, UInt8, String?)] = [] // destination, prefix, gateway
|
||||||
var optDNSServers: [String] = []
|
var optDNSServers: [String]?
|
||||||
var optSearchDomain: String?
|
var optSearchDomain: String?
|
||||||
var optHTTPProxy: Proxy?
|
var optHTTPProxy: Proxy?
|
||||||
var optHTTPSProxy: Proxy?
|
var optHTTPSProxy: Proxy?
|
||||||
|
@ -482,7 +482,10 @@ public class ConfigurationParser {
|
||||||
guard $0.count == 2 else {
|
guard $0.count == 2 else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
optDNSServers.append($0[1])
|
if optDNSServers == nil {
|
||||||
|
optDNSServers = []
|
||||||
|
}
|
||||||
|
optDNSServers?.append($0[1])
|
||||||
}
|
}
|
||||||
Regex.domain.enumerateArguments(in: line) {
|
Regex.domain.enumerateArguments(in: line) {
|
||||||
guard $0.count == 2 else {
|
guard $0.count == 2 else {
|
||||||
|
|
Loading…
Reference in New Issue