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

Commit 59da962b authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Delete the legacy framework code for manipulating ND offload.

This only worked on broadcom devices, and was superseded in
M by a wifi HAL call made by IpManager.

Test: bullhead builds, boots
Change-Id: I711cae7dafe171c2c8b4e84a229adbcad27f3d14
parent 7bbe3eee
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -103,11 +103,6 @@ interface INetworkManagementService
     */
    void setIPv6AddrGenMode(String iface, int mode);

    /**
     * Enables or enables IPv6 ND offload.
     */
    void setInterfaceIpv6NdOffload(String iface, boolean enable);

    /**
     * Add the specified route to the interface.
     */
+0 −11
Original line number Diff line number Diff line
@@ -1139,17 +1139,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        }
    }

    @Override
    public void setInterfaceIpv6NdOffload(String iface, boolean enable) {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
        try {
            mConnector.execute(
                    "interface", "ipv6ndoffload", iface, (enable ? "enable" : "disable"));
        } catch (NativeDaemonConnectorException e) {
            throw e.rethrowAsParcelableException();
        }
    }

    @Override
    public void addRoute(int netId, RouteInfo route) {
        modifyRoute("add", "" + netId, route);
+0 −18
Original line number Diff line number Diff line
@@ -152,7 +152,6 @@ public class Nat464Xlat extends BaseNetworkObserver {
     * turn ND offload off if on WiFi.
     */
    private void enterRunningState() {
        maybeSetIpv6NdOffload(mBaseIface, false);
        mState = State.RUNNING;
    }

@@ -160,10 +159,6 @@ public class Nat464Xlat extends BaseNetworkObserver {
     * Stop clatd, and turn ND offload on if it had been turned off.
     */
    private void enterStoppingState() {
        if (isRunning()) {
            maybeSetIpv6NdOffload(mBaseIface, true);
        }

        try {
            mNMService.stopClatd(mBaseIface);
        } catch(RemoteException|IllegalStateException e) {
@@ -279,19 +274,6 @@ public class Nat464Xlat extends BaseNetworkObserver {
        }
    }

    private void maybeSetIpv6NdOffload(String iface, boolean on) {
        // TODO: migrate to NetworkCapabilities.TRANSPORT_*.
        if (mNetwork.networkInfo.getType() != ConnectivityManager.TYPE_WIFI) {
            return;
        }
        try {
            Slog.d(TAG, (on ? "En" : "Dis") + "abling ND offload on " + iface);
            mNMService.setInterfaceIpv6NdOffload(iface, on);
        } catch(RemoteException|IllegalStateException e) {
            Slog.w(TAG, "Changing IPv6 ND offload on " + iface + "failed: " + e);
        }
    }

    /**
     * Adds stacked link on base link and transitions to RUNNING state.
     */
+0 −4
Original line number Diff line number Diff line
@@ -126,7 +126,6 @@ public class Nat464XlatTest {
        mLooper.dispatchNext();

        verify(mNms).getInterfaceConfig(eq(STACKED_IFACE));
        verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(false));
        verify(mConnectivity).handleUpdateLinkProperties(eq(mNai), c.capture());
        assertFalse(c.getValue().getStackedLinks().isEmpty());
        assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE));
@@ -136,7 +135,6 @@ public class Nat464XlatTest {
        nat.stop();

        verify(mNms).stopClatd(eq(BASE_IFACE));
        verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(true));

        // Stacked interface removed notification arrives.
        nat.interfaceRemoved(STACKED_IFACE);
@@ -167,7 +165,6 @@ public class Nat464XlatTest {
        mLooper.dispatchNext();

        verify(mNms).getInterfaceConfig(eq(STACKED_IFACE));
        verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(false));
        verify(mConnectivity, times(1)).handleUpdateLinkProperties(eq(mNai), c.capture());
        assertFalse(c.getValue().getStackedLinks().isEmpty());
        assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE));
@@ -179,7 +176,6 @@ public class Nat464XlatTest {

        verify(mNms).unregisterObserver(eq(nat));
        verify(mNms).stopClatd(eq(BASE_IFACE));
        verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(true));
        verify(mConnectivity, times(2)).handleUpdateLinkProperties(eq(mNai), c.capture());
        assertTrue(c.getValue().getStackedLinks().isEmpty());
        assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE));