diff src/solaris/native/java/net/Inet6AddressImpl.c @ 5512:79ce384ed535

7163874: InetAddress.isReachable should support pinging 0.0.0.0 Reviewed-by: alanb, chegar
author youdwei
date Fri, 11 May 2012 16:20:46 +0800
parents a48da818ed65
children eefd9678efbd
line wrap: on
line diff
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Mon Apr 16 11:12:10 2012 +0800
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Fri May 11 16:20:46 2012 +0800
@@ -539,10 +539,15 @@
            *       from the host that we are trying to determine is reachable.
            */
           if (n >= 8 && icmp6->icmp6_type == ICMP6_ECHO_REPLY &&
-              (ntohs(icmp6->icmp6_id) == pid) &&
-              NET_IsEqual(caddr, recv_caddr)) {
-            close(fd);
-            return JNI_TRUE;
+              (ntohs(icmp6->icmp6_id) == pid)) {
+            if (NET_IsEqual(caddr, recv_caddr)) {
+              close(fd);
+              return JNI_TRUE;
+            }
+            if (NET_IsZeroAddr(caddr)) {
+              close(fd);
+              return JNI_TRUE;
+            }
           }
         }
       } while (tmout2 > 0);