about summary refs log tree commit diff
path: root/nss/getXXbyYY.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/getXXbyYY.c')
-rw-r--r--nss/getXXbyYY.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/nss/getXXbyYY.c b/nss/getXXbyYY.c
index 21baad9474..a79fd08fef 100644
--- a/nss/getXXbyYY.c
+++ b/nss/getXXbyYY.c
@@ -96,6 +96,16 @@ FUNCTION_NAME (ADD_PARAMS)
   if (buffer != NULL)
     {
 #ifdef HANDLE_DIGITS_DOTS
+      /* We have to test for the use of IPv6 which can only be done by
+	 examining `_res'.  */
+      if ((_res.options & RES_INIT) == 0 && res_init () == -1)
+	{
+# ifdef NEED_H_ERRNO
+	  h_errno_tmp = NETDB_INTERNAL;
+# endif
+	  result = NULL;
+	  goto done;
+	}
 # include "digits_dots.c"
 #endif
     }