diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2012-01-25 11:30:39 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-01-25 11:30:39 -0800 |
commit | 109533519153307b10e2b3ae327ca4b4cd0c75d3 (patch) | |
tree | c9234597634d3c6a52dd76a38779779cd8f35908 /services | |
parent | 95306d85005f165e10a25ad45cadadec6e1f6a31 (diff) | |
parent | 44f64c965776ae65ff85ef8c37afb7e14483bdf2 (diff) | |
download | frameworks_base-109533519153307b10e2b3ae327ca4b4cd0c75d3.zip frameworks_base-109533519153307b10e2b3ae327ca4b4cd0c75d3.tar.gz frameworks_base-109533519153307b10e2b3ae327ca4b4cd0c75d3.tar.bz2 |
am 44f64c96: Merge "Filter our v6 address from tethering dns." into ics-mr1
* commit '44f64c965776ae65ff85ef8c37afb7e14483bdf2':
Filter our v6 address from tethering dns.
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/connectivity/Tethering.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java index ed7324c..cc1df4f 100644 --- a/services/java/com/android/server/connectivity/Tethering.java +++ b/services/java/com/android/server/connectivity/Tethering.java @@ -55,6 +55,7 @@ import com.google.android.collect.Lists; import java.io.FileDescriptor; import java.io.PrintWriter; import java.net.InetAddress; +import java.net.Inet4Address; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -1326,7 +1327,17 @@ public class Tethering extends INetworkManagementEventObserver.Stub { String[] dnsServers = mDefaultDnsServers; Collection<InetAddress> dnses = linkProperties.getDnses(); if (dnses != null) { - dnsServers = NetworkUtils.makeStrings(dnses); + // 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); + } } try { mNMService.setDnsForwarders(dnsServers); @@ -1384,11 +1395,12 @@ public class Tethering extends INetworkManagementEventObserver.Stub { boolean mTryCell = !WAIT_FOR_NETWORK_TO_SETTLE; @Override public void enter() { + turnOnMasterTetherSettings(); // may transition us out + mTryCell = !WAIT_FOR_NETWORK_TO_SETTLE; // better try something first pass // or crazy tests cases will fail chooseUpstreamType(mTryCell); mTryCell = !mTryCell; - turnOnMasterTetherSettings(); // may transition us out } @Override public void exit() { |