It appears that there is an undocumented minimum timeout in the
IcmpSendEcho* functions. If the timeout parameter is set to a number
below this minimum timeout it is effectively ignored. Thus if you wanted
to ensure that you could ping a particular host within a certain timeout
less than the undocumented minimum, you could potentially receive a
false positive. (i.e. if you set the timeout to 20ms but the ping takes
30ms, IcmpSendEcho will still succeed)
The following fix checks the icmp reply packet and compares the round
trip time to the requested timeout parameter before deciding whether the
call was successful or not:
http://cr.openjdk.java.net/~robm/8143397/webrev.01/
-Rob