Check if cfg.sessionConfiguration.dnsServers is empty (#198)
This commit is contained in:
parent
790ec276db
commit
4b3f3dee5f
|
@ -718,7 +718,13 @@ extension OpenVPNTunnelProvider: OpenVPNSessionDelegate {
|
||||||
|
|
||||||
// fall back
|
// fall back
|
||||||
if dnsSettings == nil {
|
if dnsSettings == nil {
|
||||||
dnsServers = cfg.sessionConfiguration.dnsServers ?? options.dnsServers ?? []
|
dnsServers = []
|
||||||
|
if let servers = cfg.sessionConfiguration.dnsServers,
|
||||||
|
!servers.isEmpty {
|
||||||
|
dnsServers = servers
|
||||||
|
} else if let servers = options.dnsServers {
|
||||||
|
dnsServers = servers
|
||||||
|
}
|
||||||
if !dnsServers.isEmpty {
|
if !dnsServers.isEmpty {
|
||||||
log.info("DNS: Using servers \(dnsServers.maskedDescription)")
|
log.info("DNS: Using servers \(dnsServers.maskedDescription)")
|
||||||
dnsSettings = NEDNSSettings(servers: dnsServers)
|
dnsSettings = NEDNSSettings(servers: dnsServers)
|
||||||
|
|
Loading…
Reference in New Issue