summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2011-08-16 14:25:30 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-16 14:25:30 -0700
commit1db7f7940e24ad359a02aac07eb6b8b03f3f9804 (patch)
tree7b19634946ecb70e28ac59a01a72d09be6856ebe /services
parentf01e16a0ff1e4df10d177a47eae741e1a3ead9ce (diff)
parent0c074e68437f1a705a8e73ac32e8e4dec370ec43 (diff)
downloadframeworks_base-1db7f7940e24ad359a02aac07eb6b8b03f3f9804.zip
frameworks_base-1db7f7940e24ad359a02aac07eb6b8b03f3f9804.tar.gz
frameworks_base-1db7f7940e24ad359a02aac07eb6b8b03f3f9804.tar.bz2
Merge "VPN: reset legacy VPN when resetting IPv4 addresses."
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ConnectivityService.java10
-rw-r--r--services/java/com/android/server/connectivity/Vpn.java4
2 files changed, 11 insertions, 3 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index a506636..81dc1a8 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -1780,14 +1780,20 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mCurrentLinkProperties[netType] = newLp;
boolean resetDns = updateRoutes(newLp, curLp, mNetConfigs[netType].isDefault());
- if (doReset || resetMask != 0 || resetDns) {
+ if (resetMask != 0 || resetDns) {
LinkProperties linkProperties = mNetTrackers[netType].getLinkProperties();
if (linkProperties != null) {
String iface = linkProperties.getInterfaceName();
if (TextUtils.isEmpty(iface) == false) {
- if (doReset || resetMask != 0) {
+ if (resetMask != 0) {
if (DBG) log("resetConnections(" + iface + ", " + resetMask + ")");
NetworkUtils.resetConnections(iface, resetMask);
+
+ // Tell VPN the interface is down. It is a temporary
+ // but effective fix to make VPN aware of the change.
+ if ((resetMask & NetworkUtils.RESET_IPV4_ADDRESSES) != 0) {
+ mVpn.interfaceStatusChanged(iface, false);
+ }
}
if (resetDns) {
if (DBG) log("resetting DNS cache for " + iface);
diff --git a/services/java/com/android/server/connectivity/Vpn.java b/services/java/com/android/server/connectivity/Vpn.java
index d9da92c..6b65e07 100644
--- a/services/java/com/android/server/connectivity/Vpn.java
+++ b/services/java/com/android/server/connectivity/Vpn.java
@@ -265,7 +265,6 @@ public class Vpn extends INetworkManagementEventObserver.Stub {
// INetworkManagementEventObserver.Stub
@Override
public void interfaceLinkStateChanged(String interfaze, boolean up) {
- interfaceStatusChanged(interfaze, up);
}
// INetworkManagementEventObserver.Stub
@@ -280,6 +279,9 @@ public class Vpn extends INetworkManagementEventObserver.Stub {
if (mConnection != null) {
mContext.unbindService(mConnection);
mConnection = null;
+ } else if (mLegacyVpnRunner != null) {
+ mLegacyVpnRunner.exit();
+ mLegacyVpnRunner = null;
}
}
}