Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b5fd05d authored by Wink Saville's avatar Wink Saville Committed by Android (Google) Code Review
Browse files

Revert "Fail fast if somebody is adding default routes"

This reverts commit 6f210bd0

Mako wouldn't boot for me, reverting for now.

Change-Id: Ie92d6bf77811e7257e86d65e1e15e1973c027cd7
parent 6f210bd0
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -2306,20 +2306,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {

        boolean routesChanged = (routeDiff.removed.size() != 0 || routeDiff.added.size() != 0);

        // look for a radio-added default route (v4-only for now TODO)
        RouteInfo[] routes = new RouteInfo[0];
        try {
            routes = mNetd.getRoutes(newLp.getInterfaceName());
        } catch (Exception e) {}

        for (RouteInfo route : routes) {
            if (route.isDefaultRoute() && route.getGateway() instanceof Inet4Address &&
                    mAddedRoutes.contains(route) == false) {
                throw new IllegalStateException("Unexpected default route found for interface "
                        + newLp.getInterfaceName());
            }
        }

        for (RouteInfo r : routeDiff.removed) {
            if (isLinkDefault || ! r.isDefaultRoute()) {
                removeRoute(curLp, r, TO_DEFAULT_TABLE);
+2 −2
Original line number Diff line number Diff line
@@ -711,7 +711,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub
                        InetAddress gatewayAddr =
                                NetworkUtils.intToInetAddress((int)Long.parseLong(gate, 16));

                        RouteInfo route = new RouteInfo(linkAddress, gatewayAddr, iface);
                        RouteInfo route = new RouteInfo(linkAddress, gatewayAddr);
                        routes.add(route);
                    } catch (Exception e) {
                        Log.e(TAG, "Error parsing route " + s + " : " + e);
@@ -743,7 +743,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub

                        InetAddress gateAddr = NetworkUtils.hexToInet6Address(gate);

                        RouteInfo route = new RouteInfo(linkAddress, gateAddr, iface);
                        RouteInfo route = new RouteInfo(linkAddress, gateAddr);
                        routes.add(route);
                    } catch (Exception e) {
                        Log.e(TAG, "Error parsing route " + s + " : " + e);