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:
Jason A. Donenfeld
2018-04-27 18:34:52 +02:00
parent 9c6f9135e9
commit 693228985d
4 changed files with 29 additions and 14 deletions
@@ -144,8 +144,6 @@ public class Peer extends BaseObservable implements Parcelable {
public void addAllowedIPs(String[] allowedIPs) {
if (allowedIPs != null && allowedIPs.length > 0) {
for (final String allowedIP : allowedIPs) {
if (allowedIP.isEmpty())
throw new IllegalArgumentException("AllowedIP is empty");
this.allowedIPsList.add(new IPCidr(allowedIP));
}
}