From 1f3ea57ee9f0cabdcfd2b585f16bf754984a669d Mon Sep 17 00:00:00 2001 From: schwabe Date: Sun, 29 Apr 2012 15:22:01 +0200 Subject: Version 0.4 fixes iusse #1 fixes iusse #2 fixes iusse #3 --- src/de/blinkt/openvpn/OpenVPN.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/de/blinkt/openvpn/OpenVPN.java') diff --git a/src/de/blinkt/openvpn/OpenVPN.java b/src/de/blinkt/openvpn/OpenVPN.java index bca276c9..c3d92a4c 100644 --- a/src/de/blinkt/openvpn/OpenVPN.java +++ b/src/de/blinkt/openvpn/OpenVPN.java @@ -8,7 +8,6 @@ import android.util.Log; public class OpenVPN { private static OpenVpnService mOpenVpnService; - private static String localip; private static final int MAXLOGENTRIES = 500; public static native int startOpenVPNThread(); public static native int startOpenVPNThreadArgs(String argv[]); @@ -32,14 +31,15 @@ public class OpenVPN { } static void addRoute(String dest,String mask, String gw) { - Log.i("openvpn" ,"Got Routing information " + dest + " " + mask + " " + gw ); + Log.i("openvpn" ,"Got Routing information " + dest + " " + mask + " " + gw ); + mOpenVpnService.addRoute(dest,mask); } synchronized static void logMessage(int level,String prefix, String message) { - logbuffer.addFirst(prefix + " " + message); + logbuffer.addLast(prefix + " " + message); if(logbuffer.size()>MAXLOGENTRIES) - logbuffer.removeLast(); + logbuffer.removeFirst(); // The garbage collector does not collect the String from native // but kills me for logging 100 messages with too many references :( @@ -62,10 +62,10 @@ public class OpenVPN { } - static void addInterfaceInfo(int mtu, String local, String remote) + static void addInterfaceInfo(int mtu, String local, String netmask) { - Log.i("openvpn","Got interface info M" + mtu + " L: " + local + "R: " + remote); - localip=local; + Log.i("openvpn","Got interface info M" + mtu + " L: " + local + "NM: " + netmask); + mOpenVpnService.setLocalIP(local,netmask); } static void addDns(String dns) { @@ -96,7 +96,7 @@ public class OpenVPN { public static int openTunDevice() { Log.d(TAG,"Opening tun device"); - ParcelFileDescriptor pfd = mOpenVpnService.openTun(localip); + ParcelFileDescriptor pfd = mOpenVpnService.openTun(); return pfd.detachFd(); } //! Dummy method being called to force loading of JNI Libraries -- cgit v1.2.3