jdk/src/java.base/unix/native/libnet/Inet6AddressImpl.c
changeset 41834 99c4f72c0a91
parent 41771 18c9669e76ca
child 43100 a7e3457672c7
--- a/jdk/src/java.base/unix/native/libnet/Inet6AddressImpl.c	Wed Nov 02 10:43:48 2016 +0100
+++ b/jdk/src/java.base/unix/native/libnet/Inet6AddressImpl.c	Wed Nov 02 11:52:51 2016 +0100
@@ -72,7 +72,7 @@
         hostname[NI_MAXHOST] = '\0';
     }
 
-#if defined(__solaris__) && defined(AF_INET6)
+#if defined(__solaris__)
     if (ret == 0) {
         /* Solaris doesn't want to give us a fully qualified domain name.
          * We do a reverse lookup to try and get one.  This works
@@ -251,9 +251,7 @@
     int retLen = 0;
 
     int getaddrinfo_error=0;
-#ifdef AF_INET6
     struct addrinfo hints, *res, *resNew = NULL;
-#endif /* AF_INET6 */
 
     initInetAddressIDs(env);
     JNU_CHECK_EXCEPTION_RETURN(env, NULL);
@@ -265,7 +263,6 @@
     hostname = JNU_GetStringPlatformChars(env, host, JNI_FALSE);
     CHECK_NULL_RETURN(hostname, NULL);
 
-#ifdef AF_INET6
     /* Try once, with our static buffer. */
     memset(&hints, 0, sizeof(hints));
     hints.ai_flags = AI_CANONNAME;
@@ -459,7 +456,6 @@
     }
 
     freeaddrinfo(res);
-#endif /* AF_INET6 */
 
     return ret;
 }
@@ -475,7 +471,6 @@
 
     jstring ret = NULL;
 
-#ifdef AF_INET6
     char host[NI_MAXHOST+1];
     int error = 0;
     int len = 0;
@@ -518,7 +513,6 @@
         ret = (*env)->NewStringUTF(env, host);
         CHECK_NULL_RETURN(ret, NULL);
     }
-#endif /* AF_INET6 */
 
     if (ret == NULL) {
         JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException", NULL);
@@ -533,7 +527,6 @@
         fcntl(fd, F_SETFL, flags);      \
 }
 
-#ifdef AF_INET6
 static jboolean
 ping6(JNIEnv *env, jint fd, struct sockaddr_in6* him, jint timeout,
       struct sockaddr_in6* netif, jint ttl) {
@@ -640,7 +633,6 @@
     close(fd);
     return JNI_FALSE;
 }
-#endif /* AF_INET6 */
 
 /*
  * Class:     java_net_Inet6AddressImpl
@@ -654,7 +646,6 @@
                                            jint timeout,
                                            jbyteArray ifArray,
                                            jint ttl, jint if_scope) {
-#ifdef AF_INET6
     jbyte caddr[16];
     jint fd, sz;
     struct sockaddr_in6 him6;
@@ -803,7 +794,4 @@
         close(fd);
         return JNI_FALSE;
     }
-#else /* AF_INET6 */
-    return JNI_FALSE;
-#endif /* AF_INET6 */
 }