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

Commit 48f2b5af authored by Chiachang Wang's avatar Chiachang Wang Committed by Automerger Merge Worker
Browse files

Merge "Replace the way to add legacy routing" am: aeab3f7d am: e963720c...

Merge "Replace the way to add legacy routing" am: aeab3f7d am: e963720c am: 44f88b7d am: d0705a37

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490244

Change-Id: Ibf3ef520e841a065225b15992fb924ada58ea828
parents 335397f1 d0705a37
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1917,10 +1917,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
        }
        if (DBG) log("Adding legacy route " + bestRoute +
                " for UID/PID " + uid + "/" + Binder.getCallingPid());

        final String dst = bestRoute.getDestinationLinkAddress().toString();
        final String nextHop = bestRoute.hasGateway()
                ? bestRoute.getGateway().getHostAddress() : "";
        try {
            mNMS.addLegacyRouteForNetId(netId, bestRoute, uid);
        } catch (Exception e) {
            // never crash - catch them all
            mNetd.networkAddLegacyRoute(netId, bestRoute.getInterface(), dst, nextHop , uid);
        } catch (RemoteException | ServiceSpecificException e) {
            if (DBG) loge("Exception trying to add a route: " + e);
            return false;
        }