Loading core/java/android/os/INetworkManagementService.aidl +0 −5 Original line number Original line Diff line number Diff line Loading @@ -103,11 +103,6 @@ interface INetworkManagementService */ */ void setIPv6AddrGenMode(String iface, int mode); 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. * Add the specified route to the interface. */ */ Loading services/core/java/com/android/server/NetworkManagementService.java +0 −11 Original line number Original line Diff line number Diff line Loading @@ -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 @Override public void addRoute(int netId, RouteInfo route) { public void addRoute(int netId, RouteInfo route) { modifyRoute("add", "" + netId, route); modifyRoute("add", "" + netId, route); Loading services/core/java/com/android/server/connectivity/Nat464Xlat.java +0 −18 Original line number Original line Diff line number Diff line Loading @@ -152,7 +152,6 @@ public class Nat464Xlat extends BaseNetworkObserver { * turn ND offload off if on WiFi. * turn ND offload off if on WiFi. */ */ private void enterRunningState() { private void enterRunningState() { maybeSetIpv6NdOffload(mBaseIface, false); mState = State.RUNNING; mState = State.RUNNING; } } Loading @@ -160,10 +159,6 @@ public class Nat464Xlat extends BaseNetworkObserver { * Stop clatd, and turn ND offload on if it had been turned off. * Stop clatd, and turn ND offload on if it had been turned off. */ */ private void enterStoppingState() { private void enterStoppingState() { if (isRunning()) { maybeSetIpv6NdOffload(mBaseIface, true); } try { try { mNMService.stopClatd(mBaseIface); mNMService.stopClatd(mBaseIface); } catch(RemoteException|IllegalStateException e) { } catch(RemoteException|IllegalStateException e) { Loading Loading @@ -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. * Adds stacked link on base link and transitions to RUNNING state. */ */ Loading tests/net/java/com/android/server/connectivity/Nat464XlatTest.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -126,7 +126,6 @@ public class Nat464XlatTest { mLooper.dispatchNext(); mLooper.dispatchNext(); verify(mNms).getInterfaceConfig(eq(STACKED_IFACE)); verify(mNms).getInterfaceConfig(eq(STACKED_IFACE)); verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(false)); verify(mConnectivity).handleUpdateLinkProperties(eq(mNai), c.capture()); verify(mConnectivity).handleUpdateLinkProperties(eq(mNai), c.capture()); assertFalse(c.getValue().getStackedLinks().isEmpty()); assertFalse(c.getValue().getStackedLinks().isEmpty()); assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); Loading @@ -136,7 +135,6 @@ public class Nat464XlatTest { nat.stop(); nat.stop(); verify(mNms).stopClatd(eq(BASE_IFACE)); verify(mNms).stopClatd(eq(BASE_IFACE)); verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(true)); // Stacked interface removed notification arrives. // Stacked interface removed notification arrives. nat.interfaceRemoved(STACKED_IFACE); nat.interfaceRemoved(STACKED_IFACE); Loading Loading @@ -167,7 +165,6 @@ public class Nat464XlatTest { mLooper.dispatchNext(); mLooper.dispatchNext(); verify(mNms).getInterfaceConfig(eq(STACKED_IFACE)); verify(mNms).getInterfaceConfig(eq(STACKED_IFACE)); verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(false)); verify(mConnectivity, times(1)).handleUpdateLinkProperties(eq(mNai), c.capture()); verify(mConnectivity, times(1)).handleUpdateLinkProperties(eq(mNai), c.capture()); assertFalse(c.getValue().getStackedLinks().isEmpty()); assertFalse(c.getValue().getStackedLinks().isEmpty()); assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); Loading @@ -179,7 +176,6 @@ public class Nat464XlatTest { verify(mNms).unregisterObserver(eq(nat)); verify(mNms).unregisterObserver(eq(nat)); verify(mNms).stopClatd(eq(BASE_IFACE)); verify(mNms).stopClatd(eq(BASE_IFACE)); verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(true)); verify(mConnectivity, times(2)).handleUpdateLinkProperties(eq(mNai), c.capture()); verify(mConnectivity, times(2)).handleUpdateLinkProperties(eq(mNai), c.capture()); assertTrue(c.getValue().getStackedLinks().isEmpty()); assertTrue(c.getValue().getStackedLinks().isEmpty()); assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); Loading Loading
core/java/android/os/INetworkManagementService.aidl +0 −5 Original line number Original line Diff line number Diff line Loading @@ -103,11 +103,6 @@ interface INetworkManagementService */ */ void setIPv6AddrGenMode(String iface, int mode); 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. * Add the specified route to the interface. */ */ Loading
services/core/java/com/android/server/NetworkManagementService.java +0 −11 Original line number Original line Diff line number Diff line Loading @@ -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 @Override public void addRoute(int netId, RouteInfo route) { public void addRoute(int netId, RouteInfo route) { modifyRoute("add", "" + netId, route); modifyRoute("add", "" + netId, route); Loading
services/core/java/com/android/server/connectivity/Nat464Xlat.java +0 −18 Original line number Original line Diff line number Diff line Loading @@ -152,7 +152,6 @@ public class Nat464Xlat extends BaseNetworkObserver { * turn ND offload off if on WiFi. * turn ND offload off if on WiFi. */ */ private void enterRunningState() { private void enterRunningState() { maybeSetIpv6NdOffload(mBaseIface, false); mState = State.RUNNING; mState = State.RUNNING; } } Loading @@ -160,10 +159,6 @@ public class Nat464Xlat extends BaseNetworkObserver { * Stop clatd, and turn ND offload on if it had been turned off. * Stop clatd, and turn ND offload on if it had been turned off. */ */ private void enterStoppingState() { private void enterStoppingState() { if (isRunning()) { maybeSetIpv6NdOffload(mBaseIface, true); } try { try { mNMService.stopClatd(mBaseIface); mNMService.stopClatd(mBaseIface); } catch(RemoteException|IllegalStateException e) { } catch(RemoteException|IllegalStateException e) { Loading Loading @@ -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. * Adds stacked link on base link and transitions to RUNNING state. */ */ Loading
tests/net/java/com/android/server/connectivity/Nat464XlatTest.java +0 −4 Original line number Original line Diff line number Diff line Loading @@ -126,7 +126,6 @@ public class Nat464XlatTest { mLooper.dispatchNext(); mLooper.dispatchNext(); verify(mNms).getInterfaceConfig(eq(STACKED_IFACE)); verify(mNms).getInterfaceConfig(eq(STACKED_IFACE)); verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(false)); verify(mConnectivity).handleUpdateLinkProperties(eq(mNai), c.capture()); verify(mConnectivity).handleUpdateLinkProperties(eq(mNai), c.capture()); assertFalse(c.getValue().getStackedLinks().isEmpty()); assertFalse(c.getValue().getStackedLinks().isEmpty()); assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); Loading @@ -136,7 +135,6 @@ public class Nat464XlatTest { nat.stop(); nat.stop(); verify(mNms).stopClatd(eq(BASE_IFACE)); verify(mNms).stopClatd(eq(BASE_IFACE)); verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(true)); // Stacked interface removed notification arrives. // Stacked interface removed notification arrives. nat.interfaceRemoved(STACKED_IFACE); nat.interfaceRemoved(STACKED_IFACE); Loading Loading @@ -167,7 +165,6 @@ public class Nat464XlatTest { mLooper.dispatchNext(); mLooper.dispatchNext(); verify(mNms).getInterfaceConfig(eq(STACKED_IFACE)); verify(mNms).getInterfaceConfig(eq(STACKED_IFACE)); verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(false)); verify(mConnectivity, times(1)).handleUpdateLinkProperties(eq(mNai), c.capture()); verify(mConnectivity, times(1)).handleUpdateLinkProperties(eq(mNai), c.capture()); assertFalse(c.getValue().getStackedLinks().isEmpty()); assertFalse(c.getValue().getStackedLinks().isEmpty()); assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); assertTrue(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); Loading @@ -179,7 +176,6 @@ public class Nat464XlatTest { verify(mNms).unregisterObserver(eq(nat)); verify(mNms).unregisterObserver(eq(nat)); verify(mNms).stopClatd(eq(BASE_IFACE)); verify(mNms).stopClatd(eq(BASE_IFACE)); verify(mNms).setInterfaceIpv6NdOffload(eq(BASE_IFACE), eq(true)); verify(mConnectivity, times(2)).handleUpdateLinkProperties(eq(mNai), c.capture()); verify(mConnectivity, times(2)).handleUpdateLinkProperties(eq(mNai), c.capture()); assertTrue(c.getValue().getStackedLinks().isEmpty()); assertTrue(c.getValue().getStackedLinks().isEmpty()); assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); assertFalse(c.getValue().getAllInterfaceNames().contains(STACKED_IFACE)); Loading