Loading core/java/android/net/RouteInfo.java +7 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ public class RouteInfo implements Parcelable { private final boolean mIsDefault; private final boolean mIsHost; private final boolean mHasGateway; /** * Constructs a RouteInfo object. Loading Loading @@ -97,6 +98,8 @@ public class RouteInfo implements Parcelable { gateway = Inet6Address.ANY; } } mHasGateway = (!gateway.isAnyLocalAddress()); mDestination = new LinkAddress(NetworkUtils.getNetworkPart(destination.getAddress(), destination.getNetworkPrefixLength()), destination.getNetworkPrefixLength()); mGateway = gateway; Loading Loading @@ -171,6 +174,10 @@ public class RouteInfo implements Parcelable { return mIsHost; } public boolean hasGateway() { return mHasGateway; } public String toString() { String val = ""; if (mDestination != null) val = mDestination.toString(); Loading services/java/com/android/server/ConnectivityService.java +1 −2 Original line number Diff line number Diff line Loading @@ -1470,8 +1470,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { loge("Error modifying route - no interface name"); return false; } if (r.isHostRoute() == false) { if (r.hasGateway()) { RouteInfo bestRoute = RouteInfo.selectBestRoute(lp.getAllRoutes(), r.getGateway()); if (bestRoute != null) { if (bestRoute.getGateway().equals(r.getGateway())) { Loading services/java/com/android/server/wifi/WifiService.java +1 −1 Original line number Diff line number Diff line Loading @@ -734,7 +734,7 @@ public final class WifiService extends IWifiManager.Stub { if (gateway instanceof Inet4Address) { info.gateway = NetworkUtils.inetAddressToInt((Inet4Address)gateway); } } else if (r.isHostRoute()) { } else if (r.hasGateway() == false) { LinkAddress dest = r.getDestination(); if (dest.getAddress() instanceof Inet4Address) { info.netmask = NetworkUtils.prefixLengthToNetmaskInt( Loading Loading
core/java/android/net/RouteInfo.java +7 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ public class RouteInfo implements Parcelable { private final boolean mIsDefault; private final boolean mIsHost; private final boolean mHasGateway; /** * Constructs a RouteInfo object. Loading Loading @@ -97,6 +98,8 @@ public class RouteInfo implements Parcelable { gateway = Inet6Address.ANY; } } mHasGateway = (!gateway.isAnyLocalAddress()); mDestination = new LinkAddress(NetworkUtils.getNetworkPart(destination.getAddress(), destination.getNetworkPrefixLength()), destination.getNetworkPrefixLength()); mGateway = gateway; Loading Loading @@ -171,6 +174,10 @@ public class RouteInfo implements Parcelable { return mIsHost; } public boolean hasGateway() { return mHasGateway; } public String toString() { String val = ""; if (mDestination != null) val = mDestination.toString(); Loading
services/java/com/android/server/ConnectivityService.java +1 −2 Original line number Diff line number Diff line Loading @@ -1470,8 +1470,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { loge("Error modifying route - no interface name"); return false; } if (r.isHostRoute() == false) { if (r.hasGateway()) { RouteInfo bestRoute = RouteInfo.selectBestRoute(lp.getAllRoutes(), r.getGateway()); if (bestRoute != null) { if (bestRoute.getGateway().equals(r.getGateway())) { Loading
services/java/com/android/server/wifi/WifiService.java +1 −1 Original line number Diff line number Diff line Loading @@ -734,7 +734,7 @@ public final class WifiService extends IWifiManager.Stub { if (gateway instanceof Inet4Address) { info.gateway = NetworkUtils.inetAddressToInt((Inet4Address)gateway); } } else if (r.isHostRoute()) { } else if (r.hasGateway() == false) { LinkAddress dest = r.getDestination(); if (dest.getAddress() instanceof Inet4Address) { info.netmask = NetworkUtils.prefixLengthToNetmaskInt( Loading