OSDN Git Service

Monitor the right interface re VPN
authorRobert Greenwalt <rgreenwalt@google.com>
Sat, 13 Oct 2012 00:02:45 +0000 (17:02 -0700)
committerRobert Greenwalt <rgreenwalt@google.com>
Sat, 13 Oct 2012 00:02:45 +0000 (17:02 -0700)
Must remember the outer interface - undoes a change from a
couple months ago that broke things.

bug:7336302
Change-Id: Ia4f60862c60f3078853e151980e09cbf22a57222

services/java/com/android/server/connectivity/Vpn.java

index 03ff21f..bb19cc7 100644 (file)
@@ -628,6 +628,7 @@ public class Vpn extends BaseNetworkStateTracker {
         private final String[] mDaemons;
         private final String[][] mArguments;
         private final LocalSocket[] mSockets;
+        private final String mOuterInterface;
 
         private long mTimer = -1;
 
@@ -638,10 +639,15 @@ public class Vpn extends BaseNetworkStateTracker {
             // TODO: clear arguments from memory once launched
             mArguments = new String[][] {racoon, mtpd};
             mSockets = new LocalSocket[mDaemons.length];
+
+            // This is the interface which VPN is running on,
+            // mConfig.interfaze will change to point to OUR
+            // internal interface soon. TODO - add inner/outer to mconfig
+            mOuterInterface = mConfig.interfaze;
         }
 
         public void check(String interfaze) {
-            if (interfaze.equals(mConfig.interfaze)) {
+            if (interfaze.equals(mOuterInterface)) {
                 Log.i(TAG, "Legacy VPN is going down with " + interfaze);
                 exit();
             }