Add direct routes to DNS servers
If VPN is not default gateway. Further fix of #94
This commit is contained in:
parent
0b72a30cdd
commit
f799f47c25
|
@ -618,6 +618,17 @@ extension TunnelKitProvider: SessionProxyDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
// add direct routes to DNS servers
|
||||
if !isGateway {
|
||||
for server in dnsServers {
|
||||
if server.contains(":") {
|
||||
ipv6Settings?.includedRoutes?.insert(NEIPv6Route(destinationAddress: server, networkPrefixLength: 128), at: 0)
|
||||
} else {
|
||||
ipv4Settings?.includedRoutes?.insert(NEIPv4Route(destinationAddress: server, subnetMask: "255.255.255.255"), at: 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var proxySettings: NEProxySettings?
|
||||
if let httpsProxy = cfg.sessionConfiguration.httpsProxy ?? reply.options.httpsProxy {
|
||||
proxySettings = NEProxySettings()
|
||||
|
|
Loading…
Reference in New Issue