Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 748a509f authored by Erik Kline's avatar Erik Kline
Browse files

Pass both IPv4 and IPv6 DNS servers as tethering DNS forwarders

Bug: 9580643
Change-Id: I5b37b9e7a7a10a624bce79836ef876be9d355e90
parent 46688366
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -1353,18 +1353,9 @@ public class Tethering extends BaseNetworkObserver {
                    if (iface != null) {
                        String[] dnsServers = mDefaultDnsServers;
                        Collection<InetAddress> dnses = linkProperties.getDnsServers();
                        if (dnses != null) {
                            // we currently only handle IPv4
                            ArrayList<InetAddress> v4Dnses =
                                    new ArrayList<InetAddress>(dnses.size());
                            for (InetAddress dnsAddress : dnses) {
                                if (dnsAddress instanceof Inet4Address) {
                                    v4Dnses.add(dnsAddress);
                                }
                            }
                            if (v4Dnses.size() > 0) {
                                dnsServers = NetworkUtils.makeStrings(v4Dnses);
                            }
                        if (dnses != null && !dnses.isEmpty()) {
                            // TODO: remove this invocation of NetworkUtils.makeStrings().
                            dnsServers = NetworkUtils.makeStrings(dnses);
                        }
                        try {
                            Network network = getConnectivityManager().getNetworkForType(upType);