diff options
author | Maciej Żenczykowski <maze@google.com> | 2024-04-24 20:20:03 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-04-24 20:20:03 +0000 |
commit | eef05f76d3e010174dca1fb351f0ab398de755ae (patch) | |
tree | 5fa062918dfc1d9eb851970a3bae56cb3c531646 | |
parent | 5dcad345bd246c29c447cbf61d0677b10e2b0f09 (diff) | |
parent | 65c9f5d77f5b8c0fc4a9568a9dd582349c72e820 (diff) | |
download | NetworkStack-eef05f76d3e010174dca1fb351f0ab398de755ae.tar.gz |
Merge "Clean up the onClatInterfaceStateUpdate() in IpClient" into main
-rw-r--r-- | src/android/net/ip/IpClient.java | 7 | ||||
-rw-r--r-- | src/android/net/ip/IpClientLinkObserver.java | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/android/net/ip/IpClient.java b/src/android/net/ip/IpClient.java index 92be9c1a..780f952b 100644 --- a/src/android/net/ip/IpClient.java +++ b/src/android/net/ip/IpClient.java @@ -991,10 +991,11 @@ public class IpClient extends StateMachine { @Override public void onClatInterfaceStateUpdate(boolean add) { - // TODO: when clat interface was removed, consider sending a message to - // the IpClient main StateMachine thread, in case "NDO enabled" state - // becomes tied to more things that 464xlat operation. getHandler().post(() -> { + if (mHasClatInterface == add) return; + // Clat interface information is spliced into LinkProperties by + // ConnectivityService, so it cannot be added to the LinkProperties + // here as those propagate back to ConnectivityService. mCallback.setNeighborDiscoveryOffload(add ? false : true); mHasClatInterface = add; if (mApfFilter != null) { diff --git a/src/android/net/ip/IpClientLinkObserver.java b/src/android/net/ip/IpClientLinkObserver.java index 624143bd..8f2856ff 100644 --- a/src/android/net/ip/IpClientLinkObserver.java +++ b/src/android/net/ip/IpClientLinkObserver.java @@ -159,7 +159,6 @@ public class IpClientLinkObserver { private final NetworkInformationShim mShim; private final AlarmManager.OnAlarmListener mExpirePref64Alarm; - private boolean mClatInterfaceExists; private long mNat64PrefixExpiry; /** @@ -515,17 +514,11 @@ public class IpClientLinkObserver { private void updateClatInterfaceLinkState(@Nullable final String ifname, short nlMsgType) { switch (nlMsgType) { case NetlinkConstants.RTM_NEWLINK: - if (mClatInterfaceExists) break; - maybeLog("clatInterfaceAdded", ifname); mCallback.onClatInterfaceStateUpdate(true /* add interface */); - mClatInterfaceExists = true; break; case NetlinkConstants.RTM_DELLINK: - if (!mClatInterfaceExists) break; - maybeLog("clatInterfaceRemoved", ifname); mCallback.onClatInterfaceStateUpdate(false /* remove interface */); - mClatInterfaceExists = false; break; default: |