Status Update
Comments
en...@google.com <en...@google.com> #2
excitingly, it looks like it's become possible to fix this since last time i looked at it. the problem used to be the need to be root for sending an ICMP ECHO. but linux now offers the ability for non-root processes to do it: http://lwn.net/Articles/443051/
nn...@google.com <nn...@google.com> #3
FYI: I checked in https://android-review.googlesource.com/52090 , which allows Android apps to use the ping implementation described at http://lwn.net/Articles/443051/
Now that this functionality is enabled, InetAddress.isReachable() can be modified to use IPPROTO_ICMP socket types.
Now that this functionality is enabled, InetAddress.isReachable() can be modified to use IPPROTO_ICMP socket types.
en...@google.com <en...@google.com>
bd...@google.com <bd...@google.com> #5
yikong, I've added you as a committer. can you confirm you can close now?
Description
A host that responds to ICMP ECHO REQUEST packets with ICMP ECHO RESPONSE packets and thus can be pinged from the command line but does not have TCP echo cannot be pinged with InetAddress.isReachable().
This situation frequently applies to LAN and WLAN routers.
The reason is that although the documentation of InetAddress.isReachable() says it would first try ICMP ECHO and if that fails revert to TCP ECHO, that the implementation actually never does TCP ECHO.
I have reproduced this bug on Samsung Galaxy S II GT-I9100 (Android 2.3.3).
I have verified that this bug actually is in class java.net.InetAddress by reading the source code:
The source code already contains a comment about this bug in line 816ff.