summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java4
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java2
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java4
3 files changed, 7 insertions, 3 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
index 22cc5dce..8e1873ea 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
@@ -632,9 +632,9 @@ public class ConfigParser {
private void checkRedirectParameters(VpnProfile np, Vector<Vector<String>> defgw) {
for (Vector<String> redirect: defgw)
for (int i=1;i<redirect.size();i++){
- if (defgw.get(i).equals("block-local"))
+ if (redirect.get(i).equals("block-local"))
np.mAllowLocalLAN=false;
- else if (defgw.get(i).equals("unblock-local"))
+ else if (redirect.get(i).equals("unblock-local"))
np.mAllowLocalLAN=true;
}
}
diff --git a/main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java b/main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
index 250edf42..68b30bce 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/DeviceStateReceiver.java
@@ -108,7 +108,7 @@ public class DeviceStateReceiver extends BroadcastReceiver implements ByteCountL
boolean screenOffPause = prefs.getBoolean("screenoff", false);
if (screenOffPause) {
- if (!ProfileManager.getLastConnectedVpn().mPersistTun)
+ if (ProfileManager.getLastConnectedVpn()!=null && !ProfileManager.getLastConnectedVpn().mPersistTun)
VpnStatus.logError(R.string.screen_nopersistenttun);
screen = connectState.PENDINGDISCONNECT;
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
index bc3fe552..9d6f767e 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java
@@ -538,6 +538,10 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac
NetworkSpace.ipAddress gatewayIP = new NetworkSpace.ipAddress(new CIDRIP(gateway, 32),false);
+ if (mLocalIP==null) {
+ VpnStatus.logError("Local IP address unset but adding route?! This is broken! Please contact author with log");
+ return;
+ }
NetworkSpace.ipAddress localNet = new NetworkSpace.ipAddress(mLocalIP,true);
if (localNet.containsNet(gatewayIP))
include=true;