src/java.base/unix/native/libnet/net_util_md.c
changeset 52778 dbbf46b13d52
parent 52499 768b1c612100
child 53053 8c85d34413d2
child 53317 5deff84a4d48
equal deleted inserted replaced
52777:7d3391e9df19 52778:dbbf46b13d52
   303          */
   303          */
   304         return JNI_FALSE;
   304         return JNI_FALSE;
   305     }
   305     }
   306 
   306 
   307     /*
   307     /*
   308      * If fd 0 is a socket it means we've been launched from inetd or
   308      * If fd 0 is a socket it means we may have been launched from inetd or
   309      * xinetd. If it's a socket then check the family - if it's an
   309      * xinetd. If it's a socket then check the family - if it's an
   310      * IPv4 socket then we need to disable IPv6.
   310      * IPv4 socket then we need to disable IPv6.
   311      */
   311      */
   312     if (getsockname(0, &sa.sa, &sa_len) == 0) {
   312     if (getsockname(0, &sa.sa, &sa_len) == 0) {
   313         if (sa.sa.sa_family != AF_INET6) {
   313         if (sa.sa.sa_family == AF_INET) {
   314             close(fd);
   314             close(fd);
   315             return JNI_FALSE;
   315             return JNI_FALSE;
   316         }
   316         }
   317     }
   317     }
   318 
   318