Simpler DNS server check

This commit is contained in:
M66B 2016-02-11 22:05:19 +01:00
parent d460404d59
commit 52ceccd12b
1 changed files with 2 additions and 1 deletions

View File

@ -756,7 +756,8 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
if (TextUtils.isEmpty(vpnDns.trim()))
throw new UnknownHostException("dns");
InetAddress dns = InetAddress.getByName(vpnDns);
if (dns.isAnyLocalAddress() || dns.isLinkLocalAddress() || dns.isLoopbackAddress())
// Check legacy settings
if (dns.isLoopbackAddress() || dns.isAnyLocalAddress())
throw new UnknownHostException("dns");
Log.i(TAG, "DNS using=" + dns);
return dns;