Changes between Version 1 and Version 2 of Ticket #11452, comment 21


Ignore:
Timestamp:
2015-10-21T17:19:34+02:00 (10 years ago)
Author:
stoecker

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11452, comment 21

    v1 v2  
    55The source code of {{{Inet6AddressImpl#isReachable}}} is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/share/classes/java/net/Inet6AddressImpl.java#l44 here]. In our case it is called with arguments `ip, 1000, null, 0`, so we're going to call the native method `isReachable0` with arguments `ip.getAddress(), scope, 1000, null, 0, -1`.
    66
    7 The Unix implementation is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/windows/native/java/net/Inet6AddressImpl.c#l429 here]. It first calls `ping6` if a Raw socket can be created, otherwise it tries to open a TCP connection on `Echo` port (`7`). If the connection is successful it returns `true`. The `ping6` implementation is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/solaris/native/java/net/Inet6AddressImpl.c#l574 here]. It sends a `ICMP6_ECHO_REQUEST` and expects only a `ICMP6_ECHO_REPLY` with the expected id. It also checks for address equality, I don't see anything obviously suspicious here. Maybe you do? I don't understand how it can succeed if it receives `Destination Unreachable`.
     7The Unix implementation is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/solaris/native/java/net/Inet6AddressImpl.c#l683 here]. It first calls `ping6` if a Raw socket can be created, otherwise it tries to open a TCP connection on `Echo` port (`7`). If the connection is successful it returns `true`. The `ping6` implementation is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/solaris/native/java/net/Inet6AddressImpl.c#l574 here]. It sends a `ICMP6_ECHO_REQUEST` and expects only a `ICMP6_ECHO_REPLY` with the expected id. It also checks for address equality, I don't see anything obviously suspicious here. Maybe you do? I don't understand how it can succeed if it receives `Destination Unreachable`.
    88
    9 The Windows implementation is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/solaris/native/java/net/Inet6AddressImpl.c#l683 here]. It just calls `ping6`. The `ping6` implementation is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/windows/native/java/net/Inet6AddressImpl.c#l364 here]. The Windows implementation of `ping6` is simpler: it only checks that a call to [https://msdn.microsoft.com/en-us/library/windows/desktop/aa366041(v=vs.85).aspx Icmp6SendEcho2] returns a value != 0.
     9The Windows implementation is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/windows/native/java/net/Inet6AddressImpl.c#l429 here]. It just calls `ping6`. The `ping6` implementation is [http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/c982997a738b/src/windows/native/java/net/Inet6AddressImpl.c#l364 here]. The Windows implementation of `ping6` is simpler: it only checks that a call to [https://msdn.microsoft.com/en-us/library/windows/desktop/aa366041(v=vs.85).aspx Icmp6SendEcho2] returns a value != 0.
    1010
    1111Considering that Unix implementation defines its own `ping6` mechanism, Windows implementation calls the operating system, and we have received only Linux bug reports, `ping6` is definitely incriminated but I don't see how yet.