Start using NetworkUtils.numericToInetAddress.
Generates InetAddresses without risking an accidental dns lookup. For use with supposedly numeric-only ip address strings. Change-Id: I694f3976ce1c6382854706f6557ea88a289add3a
This commit is contained in:
parent
8606b3e4a0
commit
35e34d1276
1 changed files with 2 additions and 2 deletions
|
|
@ -286,8 +286,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||
com.android.internal.R.string.config_default_dns_server);
|
||||
}
|
||||
try {
|
||||
mDefaultDns = InetAddress.getByName(dns);
|
||||
} catch (UnknownHostException e) {
|
||||
mDefaultDns = NetworkUtils.numericToInetAddress(dns);
|
||||
} catch (IllegalArgumentException e) {
|
||||
loge("Error setting defaultDns using " + dns);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue