jdk/src/solaris/native/java/net/NetworkInterface.c
changeset 6108 d5bfa0bc6123
parent 6002 4df5b9bcf842
child 6129 e76ab178e431
equal deleted inserted replaced
6007:fd42c86c4d29 6108:d5bfa0bc6123
   751 
   751 
   752     /*
   752     /*
   753      * If IPv6 is available then enumerate IPv6 addresses.
   753      * If IPv6 is available then enumerate IPv6 addresses.
   754      */
   754      */
   755 #ifdef AF_INET6
   755 #ifdef AF_INET6
   756         sock =  openSocket(env, AF_INET6);
   756 
   757         if (sock < 0 && (*env)->ExceptionOccurred(env)) {
   757         /* User can disable ipv6 expicitly by -Djava.net.preferIPv4Stack=true,
   758             freeif(ifs);
   758          * so we have to call ipv6_available()
   759             return NULL;
   759          */
   760         }
   760         if (ipv6_available()) {
   761 
   761 
   762         ifs = enumIPv6Interfaces(env, sock, ifs);
   762            sock =  openSocket(env, AF_INET6);
   763         close(sock);
   763            if (sock < 0 && (*env)->ExceptionOccurred(env)) {
   764 
   764                freeif(ifs);
   765         if ((*env)->ExceptionOccurred(env)) {
   765                return NULL;
   766             freeif(ifs);
   766            }
   767             return NULL;
   767 
   768         }
   768            ifs = enumIPv6Interfaces(env, sock, ifs);
       
   769            close(sock);
       
   770 
       
   771            if ((*env)->ExceptionOccurred(env)) {
       
   772               freeif(ifs);
       
   773               return NULL;
       
   774            }
       
   775 
       
   776        }
   769 #endif
   777 #endif
   770 
   778 
   771     return ifs;
   779     return ifs;
   772 }
   780 }
   773 
   781