Add negotiated DNS servers to VPN config am: 8b9538df8f am: d210205442 am: 8602a7cd0f
Change-Id: I661ddbceb006b626f13335ea108eacc0092243fa
This commit is contained in:
@@ -2248,12 +2248,16 @@ public class Vpn {
|
||||
final String interfaceName = mTunnelIface.getInterfaceName();
|
||||
final int maxMtu = mProfile.getMaxMtu();
|
||||
final List<LinkAddress> internalAddresses = childConfig.getInternalAddresses();
|
||||
final List<String> dnsAddrStrings = new ArrayList<>();
|
||||
|
||||
final Collection<RouteInfo> newRoutes = VpnIkev2Utils.getRoutesFromTrafficSelectors(
|
||||
childConfig.getOutboundTrafficSelectors());
|
||||
for (final LinkAddress address : internalAddresses) {
|
||||
mTunnelIface.addAddress(address.getAddress(), address.getPrefixLength());
|
||||
}
|
||||
for (InetAddress addr : childConfig.getInternalDnsServers()) {
|
||||
dnsAddrStrings.add(addr.getHostAddress());
|
||||
}
|
||||
|
||||
final NetworkAgent networkAgent;
|
||||
final LinkProperties lp;
|
||||
@@ -2269,7 +2273,9 @@ public class Vpn {
|
||||
mConfig.routes.clear();
|
||||
mConfig.routes.addAll(newRoutes);
|
||||
|
||||
// TODO: Add DNS servers from negotiation
|
||||
if (mConfig.dnsServers == null) mConfig.dnsServers = new ArrayList<>();
|
||||
mConfig.dnsServers.clear();
|
||||
mConfig.dnsServers.addAll(dnsAddrStrings);
|
||||
|
||||
networkAgent = mNetworkAgent;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user