Merge changes I18d2ccea,I4e80a75d,Ib8ea2a17,Iaba678ed am: 79d2054b14 am: 4247c39cd5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645296 Change-Id: Id6b9fcc31777ad33abfaee2a11e07df92766cd32
This commit is contained in:
@@ -643,7 +643,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
|
|||||||
String route, String gateway, String ifName) throws RemoteException {
|
String route, String gateway, String ifName) throws RemoteException {
|
||||||
final RouteInfo processRoute = new RouteInfo(new IpPrefix(route),
|
final RouteInfo processRoute = new RouteInfo(new IpPrefix(route),
|
||||||
("".equals(gateway)) ? null : InetAddresses.parseNumericAddress(gateway),
|
("".equals(gateway)) ? null : InetAddresses.parseNumericAddress(gateway),
|
||||||
ifName);
|
ifName, RouteInfo.RTN_UNICAST);
|
||||||
mDaemonHandler.post(() -> notifyRouteChange(updated, processRoute));
|
mDaemonHandler.post(() -> notifyRouteChange(updated, processRoute));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1175,11 +1175,13 @@ public class Vpn {
|
|||||||
|
|
||||||
if (!allowIPv4) {
|
if (!allowIPv4) {
|
||||||
lp.addRoute(new RouteInfo(new IpPrefix(
|
lp.addRoute(new RouteInfo(new IpPrefix(
|
||||||
NetworkStackConstants.IPV4_ADDR_ANY, 0), RTN_UNREACHABLE));
|
NetworkStackConstants.IPV4_ADDR_ANY, 0), null /*gateway*/,
|
||||||
|
null /*iface*/, RTN_UNREACHABLE));
|
||||||
}
|
}
|
||||||
if (!allowIPv6) {
|
if (!allowIPv6) {
|
||||||
lp.addRoute(new RouteInfo(new IpPrefix(
|
lp.addRoute(new RouteInfo(new IpPrefix(
|
||||||
NetworkStackConstants.IPV6_ADDR_ANY, 0), RTN_UNREACHABLE));
|
NetworkStackConstants.IPV6_ADDR_ANY, 0), null /*gateway*/,
|
||||||
|
null /*iface*/, RTN_UNREACHABLE));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Concatenate search domains into a string.
|
// Concatenate search domains into a string.
|
||||||
@@ -2699,7 +2701,8 @@ public class Vpn {
|
|||||||
|
|
||||||
mConfig.routes.clear();
|
mConfig.routes.clear();
|
||||||
for (final RouteInfo route : oldRoutes) {
|
for (final RouteInfo route : oldRoutes) {
|
||||||
mConfig.routes.add(new RouteInfo(route.getDestination(), RTN_UNREACHABLE));
|
mConfig.routes.add(new RouteInfo(route.getDestination(), null /*gateway*/,
|
||||||
|
null /*iface*/, RTN_UNREACHABLE));
|
||||||
}
|
}
|
||||||
if (mNetworkAgent != null) {
|
if (mNetworkAgent != null) {
|
||||||
mNetworkAgent.sendLinkProperties(makeLinkProperties());
|
mNetworkAgent.sendLinkProperties(makeLinkProperties());
|
||||||
@@ -3038,10 +3041,12 @@ public class Vpn {
|
|||||||
// Add a throw route for the VPN server endpoint, if one was specified.
|
// Add a throw route for the VPN server endpoint, if one was specified.
|
||||||
if (endpointAddress instanceof Inet4Address) {
|
if (endpointAddress instanceof Inet4Address) {
|
||||||
mConfig.routes.add(new RouteInfo(
|
mConfig.routes.add(new RouteInfo(
|
||||||
new IpPrefix(endpointAddress, 32), RTN_THROW));
|
new IpPrefix(endpointAddress, 32), null /*gateway*/,
|
||||||
|
null /*iface*/, RTN_THROW));
|
||||||
} else if (endpointAddress instanceof Inet6Address) {
|
} else if (endpointAddress instanceof Inet6Address) {
|
||||||
mConfig.routes.add(new RouteInfo(
|
mConfig.routes.add(new RouteInfo(
|
||||||
new IpPrefix(endpointAddress, 128), RTN_THROW));
|
new IpPrefix(endpointAddress, 128), null /*gateway*/,
|
||||||
|
null /*iface*/, RTN_THROW));
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "Unknown IP address family for VPN endpoint: "
|
Log.e(TAG, "Unknown IP address family for VPN endpoint: "
|
||||||
+ endpointAddress);
|
+ endpointAddress);
|
||||||
|
|||||||
@@ -405,7 +405,8 @@ public class VpnIkev2Utils {
|
|||||||
for (final IkeTrafficSelector selector : trafficSelectors) {
|
for (final IkeTrafficSelector selector : trafficSelectors) {
|
||||||
for (final IpPrefix prefix :
|
for (final IpPrefix prefix :
|
||||||
new IpRange(selector.startingAddress, selector.endingAddress).asIpPrefixes()) {
|
new IpRange(selector.startingAddress, selector.endingAddress).asIpPrefixes()) {
|
||||||
routes.add(new RouteInfo(prefix, null));
|
routes.add(new RouteInfo(prefix, null /*gateway*/, null /*iface*/,
|
||||||
|
RouteInfo.RTN_UNICAST));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1796,8 +1796,10 @@ public class VcnGatewayConnection extends StateMachine {
|
|||||||
lp.addDnsServer(addr);
|
lp.addDnsServer(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
lp.addRoute(new RouteInfo(new IpPrefix(Inet4Address.ANY, 0), null));
|
lp.addRoute(new RouteInfo(new IpPrefix(Inet4Address.ANY, 0), null /*gateway*/,
|
||||||
lp.addRoute(new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), null));
|
null /*iface*/, RouteInfo.RTN_UNICAST));
|
||||||
|
lp.addRoute(new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), null /*gateway*/,
|
||||||
|
null /*iface*/, RouteInfo.RTN_UNICAST));
|
||||||
|
|
||||||
lp.setMtu(gatewayConnectionConfig.getMaxMtu());
|
lp.setMtu(gatewayConnectionConfig.getMaxMtu());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user