We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 786dab3 commit 376f3f7Copy full SHA for 376f3f7
library/src/main/java/com/qiniu/android/utils/AndroidNetwork.java
@@ -44,8 +44,8 @@ public static String getHostIP() {
44
while (nis.hasMoreElements()) {
45
NetworkInterface ni = (NetworkInterface) nis.nextElement();
46
Enumeration<InetAddress> ias = ni.getInetAddresses();
47
- ia = ias.nextElement();
48
- if (ia instanceof Inet6Address) {
+ while (ias.hasMoreElements()) {
+ ia = ias.nextElement();
49
if (!ia.isLinkLocalAddress() && !ia.isLoopbackAddress()) {
50
hostIp = ia.getHostAddress();
51
break;
0 commit comments