about summary refs log tree commit diff
path: root/nss/getXXbyYY_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/getXXbyYY_r.c')
-rw-r--r--nss/getXXbyYY_r.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index 7e567a1325..3c7f2a14bb 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -115,6 +115,14 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
 #endif
 
 #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)
+    {
+      *h_errnop = NETDB_INTERNAL;
+      *result = NULL;
+      return -1;
+    }
 # define resbuf (*resbuf)
 # include "digits_dots.c"
 # undef resbuf