src/java.base/windows/native/libnet/NetworkInterface.c
changeset 52651 526b2490c616
parent 52167 b1db57cfe6bd
child 53316 066d2261108f
equal deleted inserted replaced
52650:c16b6cc93272 52651:526b2490c616
   200     if (ret != NO_ERROR) {
   200     if (ret != NO_ERROR) {
   201         free(tableP);
   201         free(tableP);
   202 
   202 
   203         JNU_ThrowByName(env, "java/lang/Error",
   203         JNU_ThrowByName(env, "java/lang/Error",
   204                 "IP Helper Library GetIfTable function failed");
   204                 "IP Helper Library GetIfTable function failed");
   205 
   205         // this different error code is to handle the case when we call
   206         return -1;
   206         // GetIpAddrTable in pure IPv6 environment
       
   207         return -2;
   207     }
   208     }
   208 
   209 
   209     /*
   210     /*
   210      * Iterate through the list of adapters
   211      * Iterate through the list of adapters
   211      */
   212      */
   398         if (tableP) {
   399         if (tableP) {
   399             free(tableP);
   400             free(tableP);
   400         }
   401         }
   401         JNU_ThrowByName(env, "java/lang/Error",
   402         JNU_ThrowByName(env, "java/lang/Error",
   402                 "IP Helper Library GetIpAddrTable function failed");
   403                 "IP Helper Library GetIpAddrTable function failed");
   403         return -1;
   404         // this different error code is to handle the case when we call
       
   405         // GetIpAddrTable in pure IPv6 environment
       
   406         return -2;
   404     }
   407     }
   405 
   408 
   406     /*
   409     /*
   407      * Iterate through the table to find the addresses with the
   410      * Iterate through the table to find the addresses with the
   408      * matching dwIndex. Ignore 0.0.0.0 addresses.
   411      * matching dwIndex. Ignore 0.0.0.0 addresses.
   555      * Get the IP addresses for this interface if necessary
   558      * Get the IP addresses for this interface if necessary
   556      * Note that 0 is a valid number of addresses.
   559      * Note that 0 is a valid number of addresses.
   557      */
   560      */
   558     if (netaddrCount < 0) {
   561     if (netaddrCount < 0) {
   559         netaddrCount = enumAddresses_win(env, ifs, &netaddrP);
   562         netaddrCount = enumAddresses_win(env, ifs, &netaddrP);
   560         if (netaddrCount == -1) {
   563         if (netaddrCount < 0) {
   561             return NULL;
   564             return NULL;
   562         }
   565         }
   563     }
   566     }
   564     addrArr = (*env)->NewObjectArray(env, netaddrCount, ia_class, NULL);
   567     addrArr = (*env)->NewObjectArray(env, netaddrCount, ia_class, NULL);
   565     if (addrArr == NULL) {
   568     if (addrArr == NULL) {