diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-05-16 12:10:32 -0700 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2014-05-16 14:02:13 -0700 |
commit | 43b76dfddbfe2a27a0658dbca8632a9b1dc8d6ff (patch) | |
tree | 6ff9c15740cc410475b3804dc99f8a91bd3bed5b | |
parent | b0650e8ff3113f9b9dbb6d249339dbd7921b4517 (diff) | |
download | frameworks_base-43b76dfddbfe2a27a0658dbca8632a9b1dc8d6ff.zip frameworks_base-43b76dfddbfe2a27a0658dbca8632a9b1dc8d6ff.tar.gz frameworks_base-43b76dfddbfe2a27a0658dbca8632a9b1dc8d6ff.tar.bz2 |
Stop clatd when starting the Nat464Xlat service.
If a runtime restart happens while clatd was running, we try to
start clatd, which causes a fatal exception because netd returns
a 400 error (clatd already started.
Bug: 13450716
Bug: 15012035
Change-Id: I102a06d6193fb5f4a1ebe5ad52e5647ff72ca0da
-rw-r--r-- | services/core/java/com/android/server/connectivity/Nat464Xlat.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/connectivity/Nat464Xlat.java b/services/core/java/com/android/server/connectivity/Nat464Xlat.java index 3884ab0..096ab66 100644 --- a/services/core/java/com/android/server/connectivity/Nat464Xlat.java +++ b/services/core/java/com/android/server/connectivity/Nat464Xlat.java @@ -74,6 +74,14 @@ public class Nat464Xlat extends BaseNetworkObserver { mIsStarted = false; mIsRunning = false; mLP = new LinkProperties(); + + // If this is a runtime restart, it's possible that clatd is already + // running, but we don't know about it. If so, stop it. + try { + if (mNMService.isClatdStarted()) { + mNMService.stopClatd(); + } + } catch(RemoteException e) {} // Well, we tried. } /** @@ -198,13 +206,13 @@ public class Nat464Xlat extends BaseNetworkObserver { NetworkUtils.resetConnections( CLAT_INTERFACE_NAME, NetworkUtils.RESET_IPV4_ADDRESSES); + mBaseLP.removeStackedLink(mLP); + updateConnectivityService(); } Slog.i(TAG, "interface " + CLAT_INTERFACE_NAME + " removed, mIsRunning = " + mIsRunning + " -> false"); mIsRunning = false; - mBaseLP.removeStackedLink(mLP); mLP.clear(); - updateConnectivityService(); Slog.i(TAG, "mLP = " + mLP); } } |