about summary refs log tree commit diff
path: root/nis/nss_nis/nis-hosts.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-10-04 11:52:10 +0200
committerFlorian Weimer <fweimer@redhat.com>2016-12-31 18:55:14 +0100
commitb76e065991ec01299225d9da90a627ebe6c1ac97 (patch)
treeac94cc82b134096975419ced320f6ed329130756 /nis/nss_nis/nis-hosts.c
parent5840c75c2d6a9b980d6789f2ca7d47a9fa067263 (diff)
downloadglibc-b76e065991ec01299225d9da90a627ebe6c1ac97.tar.gz
glibc-b76e065991ec01299225d9da90a627ebe6c1ac97.tar.xz
glibc-b76e065991ec01299225d9da90a627ebe6c1ac97.zip
resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582]
Diffstat (limited to 'nis/nss_nis/nis-hosts.c')
-rw-r--r--nis/nss_nis/nis-hosts.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/nis/nss_nis/nis-hosts.c b/nis/nss_nis/nis-hosts.c
index d266cf2d49..a337797de1 100644
--- a/nis/nss_nis/nis-hosts.c
+++ b/nis/nss_nis/nis-hosts.c
@@ -27,7 +27,7 @@
 #include <string.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#include <resolv.h>
+#include <resolv/resolv-internal.h>
 #include <libc-lock.h>
 #include <rpcsvc/yp.h>
 #include <rpcsvc/ypclnt.h>
@@ -231,8 +231,8 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen,
   __libc_lock_lock (lock);
 
   status = internal_nis_gethostent_r (host, buffer, buflen, errnop, h_errnop,
-			((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET),
-			((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0 ));
+			(res_use_inet6 () ? AF_INET6 : AF_INET),
+			(res_use_inet6 () ? AI_V4MAPPED : 0 ));
 
   __libc_lock_unlock (lock);
 
@@ -351,7 +351,7 @@ _nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host,
 
   return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop,
 				    h_errnop,
-			((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0));
+			(res_use_inet6 () ? AI_V4MAPPED : 0));
 }
 
 
@@ -359,7 +359,7 @@ enum nss_status
 _nss_nis_gethostbyname_r (const char *name, struct hostent *host, char *buffer,
 			  size_t buflen, int *errnop, int *h_errnop)
 {
-  if (_res.options & RES_USE_INET6)
+  if (res_use_inet6 ())
     {
       enum nss_status status;
 
@@ -433,8 +433,7 @@ _nss_nis_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af,
   free (result);
 
   int parse_res = parse_line (p, host, data, buflen, errnop, af,
-			      ((_res.options & RES_USE_INET6)
-			       ? AI_V4MAPPED : 0));
+			      (res_use_inet6 () ? AI_V4MAPPED : 0));
   if (__glibc_unlikely (parse_res < 1))
     {
       if (parse_res == -1)