summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Szumski <will@cowboycoders.org>2016-11-22 18:22:28 +0000
committeryvesf <yvesf-git@xapek.org>2016-11-22 23:24:15 +0100
commit8ce535e672efb48e82a559bac0f5be7136c82344 (patch)
treed705a2e850ea313861a291f76c3dcda033dffa17
parent0aa036fd7f702e5d420beb12ec5d0ac478c07121 (diff)
downloadandiodine-8ce535e672efb48e82a559bac0f5be7136c82344.tar.gz
andiodine-8ce535e672efb48e82a559bac0f5be7136c82344.zip
check for valid nameserver
-rw-r--r--src/main/java/org/xapek/andiodine/IodineVpnService.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/xapek/andiodine/IodineVpnService.java b/src/main/java/org/xapek/andiodine/IodineVpnService.java
index 80df946..02544b5 100644
--- a/src/main/java/org/xapek/andiodine/IodineVpnService.java
+++ b/src/main/java/org/xapek/andiodine/IodineVpnService.java
@@ -210,6 +210,11 @@ public class IodineVpnService extends VpnService implements Runnable {
setStatus(ACTION_STATUS_CONNECT, mConfiguration.getId(), null);
String tunnelNamesver = IodineClient.getPropertyNetDns1();
+ if (tunnelNamesver == "") {
+ Log.e(TAG, "No valid IPv4 name servers detected. Aborting...");
+ return;
+ }
+ Log.d(TAG, "using name server: " + tunnelNamesver);
if (!"".equals(mConfiguration.getTunnelNameserver())) {
tunnelNamesver = mConfiguration.getTunnelNameserver();
}