PeerProxy: Only add IPv4 DNS servers when excluding private IPs

Reported-By: Christophe-Marie Duquesne <chmd@chmd.fr>

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Samuel Holland 2019-01-02 20:21:08 -06:00 committed by Jason A. Donenfeld
parent 6d0fde218b
commit fb4f1e30d5

View File

@ -226,6 +226,7 @@ public class PeerProxy extends BaseObservable implements Parcelable {
private void setInterfaceDns(final CharSequence dnsServers) {
final List<String> newDnsRoutes = Stream.of(Attribute.split(dnsServers))
.filter(server -> !server.contains(":"))
.map(server -> server + "/32")
.collect(Collectors.toUnmodifiableList());
if (allowedIpsState == AllowedIpsState.CONTAINS_IPV4_PUBLIC_NETWORKS) {