Commit e9143d94 authored by Davide De Rosa's avatar Davide De Rosa
Browse files

Add fallback IPv4 address to PIATunnelProfile

When available.
parent a068202a
......@@ -172,7 +172,17 @@ public class PIATunnelProfile: NetworkExtensionProfile {
let port = configuration.port ?? PIATunnelProfile.defaultPort
cfg.serverAddress = "\(configuration.server.hostname):\(port)"
cfg.providerBundleIdentifier = bundleIdentifier
cfg.providerConfiguration = configuration.customConfiguration?.serialized()
var customCfg = configuration.customConfiguration
if let piaCfg = customCfg as? PIATunnelProvider.Configuration,
let bestAddress = configuration.server.bestOpenVPNAddressForUDP?.hostname { // XXX: UDP address = TCP address
var builder = piaCfg.builder()
builder.resolvedAddresses = [bestAddress]
customCfg = builder.build()
}
cfg.providerConfiguration = customCfg?.serialized()
return cfg
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment