diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-05-11 01:17:01 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-05-11 01:17:01 +0200 |
commit | 82940714ebe944e63ed70c745e1abe950673fe5b (patch) | |
tree | 8dfcf9627b5db22ffdf3ebe37d7c0529f0fb6fe9 /src/de/blinkt/openvpn/OpenVpnService.java | |
parent | 480535d1de23e30780b3ae5a166cdc59a22a2adc (diff) |
CLeanups
Fix backtrace from market console, I suspect someone tried IPv6 and I failed him/her :(
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnService.java')
-rw-r--r-- | src/de/blinkt/openvpn/OpenVpnService.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java index 9030d29a..ad20737b 100644 --- a/src/de/blinkt/openvpn/OpenVpnService.java +++ b/src/de/blinkt/openvpn/OpenVpnService.java @@ -45,7 +45,7 @@ public class OpenVpnService extends VpnService implements Handler.Callback { private Vector<CIDRIP> mRoutes=new Vector<CIDRIP>(); - private CIDRIP mLocalIP; + private CIDRIP mLocalIP=null; private OpenVpnManagementThread mSocketManager; @@ -253,7 +253,12 @@ public class OpenVpnService extends VpnService implements Handler.Callback { public ParcelFileDescriptor openTun() { Builder builder = new Builder(); - + + if(mLocalIP==null) { + OpenVPN.logMessage(0, "", getString(R.string.opentun_no_ipaddr)); + return null; + } + builder.addAddress(mLocalIP.mIp, mLocalIP.len); for (String dns : mDnslist ) { @@ -282,15 +287,16 @@ public class OpenVpnService extends VpnService implements Handler.Callback { bconfig[3] = String.format(getString(R.string.dns_domain_info, mDomain)); bconfig[4] = String.format(getString(R.string.routes_info, joinString(mRoutes))); + builder.setSession(mProfile.mName + " - " + mLocalIP); + OpenVPN.logBuilderConfig(bconfig); + // Reset information mDnslist.clear(); mRoutes.clear(); - - - builder.setSession(mProfile.mName + " - " + mLocalIP); - + mLocalIP=null; + // Let the configure Button show the Log Intent intent = new Intent(getBaseContext(),LogWindow.class); PendingIntent startLW = PendingIntent.getActivity(getApplicationContext(), 0, intent, 0); |