From 1ccc18576f80868dd1e2b57ce181ae6a21c9000e Mon Sep 17 00:00:00 2001 From: junyulai Date: Tue, 5 Jun 2018 16:10:04 +0800 Subject: [PATCH] Copy clat modified linkProperties into new one. updateLinkProperties copied the linkProperties in networkAgent, but the clat fix-up function did not copy stacked link into new one. This caused an incorrect clat iface removal, and the IPv4 network to be unreachable. Clean cherry-pick of ag/4260470 Bug: 80261579 Test: 1. ping after ipv6 only data call with 2g voice call on/off 2. runtest frameworks-net 3. run cts -m CtsNetTestCases Change-Id: Ide47a3b0680dddfcf3e2e759a59b19aee3605050 --- .../core/java/com/android/server/ConnectivityService.java | 2 +- .../java/com/android/server/connectivity/Nat464Xlat.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 2593690e4b..718c68be10 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -4646,7 +4646,7 @@ public class ConnectivityService extends IConnectivityManager.Stub // The NetworkAgentInfo does not know whether clatd is running on its network or not. Before // we do anything else, make sure its LinkProperties are accurate. if (networkAgent.clatd != null) { - networkAgent.clatd.fixupLinkProperties(oldLp); + networkAgent.clatd.fixupLinkProperties(oldLp, newLp); } updateInterfaces(newLp, oldLp, netId, networkAgent.networkCapabilities); diff --git a/services/core/java/com/android/server/connectivity/Nat464Xlat.java b/services/core/java/com/android/server/connectivity/Nat464Xlat.java index fceacba423..f523d594aa 100644 --- a/services/core/java/com/android/server/connectivity/Nat464Xlat.java +++ b/services/core/java/com/android/server/connectivity/Nat464Xlat.java @@ -224,15 +224,14 @@ public class Nat464Xlat extends BaseNetworkObserver { } /** - * Copies the stacked clat link in oldLp, if any, to the LinkProperties in mNetwork. + * Copies the stacked clat link in oldLp, if any, to the passed LinkProperties. * This is necessary because the LinkProperties in mNetwork come from the transport layer, which * has no idea that 464xlat is running on top of it. */ - public void fixupLinkProperties(LinkProperties oldLp) { + public void fixupLinkProperties(LinkProperties oldLp, LinkProperties lp) { if (!isRunning()) { return; } - LinkProperties lp = mNetwork.linkProperties; if (lp == null || lp.getAllInterfaceNames().contains(mIface)) { return; }