Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
P3
-
Resolution: Duplicate
-
Affects Version/s: 7u161
-
Fix Version/s: None
-
Component/s: core-libs
-
Subcomponent:
Description
InetAddress isReachable fails with jdk7u but passes with jdk8u.
Sample Program:
import java.net.InetAddress;
public class Test {
public static void main(String[] args) {
try {
final InetAddress addr = InetAddress.getByName("hostname");
final boolean isReachable = addr.isReachable(2000);
if (!isReachable) {
System.out.println("Not Reachable");
} else {
System.out.println("Reachable");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Excepted: Reachable
Actual: Not Reachable
Sample Program:
import java.net.InetAddress;
public class Test {
public static void main(String[] args) {
try {
final InetAddress addr = InetAddress.getByName("hostname");
final boolean isReachable = addr.isReachable(2000);
if (!isReachable) {
System.out.println("Not Reachable");
} else {
System.out.println("Reachable");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Excepted: Reachable
Actual: Not Reachable
Attachments
Issue Links
- relates to
-
JDK-8166747 Add invalid network / computer name cases to isReachable known failure switch
-
- Resolved
-
-
JDK-8133015 InetAddress.isReachable(tmout) returning wrong value on Windows for IPv6
-
- Closed
-
-
JDK-8143397 It looks like InetAddress.isReachable(timeout) works incorrectly
-
- Closed
-
-
JDK-8159410 InetAddress.isReachable returns true for non existing IP addresses
-
- Closed
-