Do not do DNS lookups for IPs
This involves reflection, which is a bummer, but it's better than doing unnecessary DNS lookups. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -172,13 +172,7 @@ public class Interface extends BaseObservable implements Parcelable {
|
||||
public void addDnses(String[] dnses) {
|
||||
if (dnses != null && dnses.length > 0) {
|
||||
for (final String dns : dnses) {
|
||||
if (dns.isEmpty())
|
||||
throw new IllegalArgumentException("DNS is empty");
|
||||
try {
|
||||
this.dnsList.add(InetAddress.getByName(dns));
|
||||
} catch (UnknownHostException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
this.dnsList.add(Attribute.parseIPString(dns));
|
||||
}
|
||||
}
|
||||
notifyPropertyChanged(BR.dnses);
|
||||
|
||||
Reference in New Issue
Block a user