summaryrefslogtreecommitdiff
path: root/nss
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 /nss
parent5840c75c2d6a9b980d6789f2ca7d47a9fa067263 (diff)
downloadglibc-b76e065991ec01299225d9da90a627ebe6c1ac97.tar.gz
resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582]
Diffstat (limited to 'nss')
-rw-r--r--nss/digits_dots.c8
-rw-r--r--nss/nss_files/files-hosts.c10
2 files changed, 9 insertions, 9 deletions
diff --git a/nss/digits_dots.c b/nss/digits_dots.c
index 57f0e4db67..14f5b56fae 100644
--- a/nss/digits_dots.c
+++ b/nss/digits_dots.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <wctype.h>
-#include <resolv.h>
+#include <resolv/resolv-internal.h>
#include <netdb.h>
#include <arpa/inet.h>
#include "nsswitch.h"
@@ -80,7 +80,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
break;
default:
- af = (_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET;
+ af = res_use_inet6 () ? AF_INET6 : AF_INET;
addr_size = af == AF_INET6 ? IN6ADDRSZ : INADDRSZ;
break;
}
@@ -167,7 +167,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
(*h_addr_ptrs)[0] = (char *) host_addr;
(*h_addr_ptrs)[1] = NULL;
resbuf->h_addr_list = *h_addr_ptrs;
- if (af == AF_INET && (_res.options & RES_USE_INET6))
+ if (af == AF_INET && res_use_inet6 ())
{
/* We need to change the IP v4 address into the
IP v6 address. */
@@ -211,7 +211,7 @@ __nss_hostname_digits_dots (const char *name, struct hostent *resbuf,
switch (af)
{
default:
- af = (_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET;
+ af = res_use_inet6 () ? AF_INET6 : AF_INET;
if (af == AF_INET6)
{
addr_size = IN6ADDRSZ;
diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
index 2a4a665d7e..8f330b19fb 100644
--- a/nss/nss_files/files-hosts.c
+++ b/nss/nss_files/files-hosts.c
@@ -21,7 +21,7 @@
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <netdb.h>
-#include <resolv.h>
+#include <resolv/resolv-internal.h>
/* Get implementation for some internal functions. */
@@ -98,8 +98,8 @@ LINE_PARSER
})
#define EXTRA_ARGS_VALUE \
- , ((_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)
#include "files-XXX.c"
#undef EXTRA_ARGS_VALUE
@@ -132,7 +132,7 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
{
/* XXX Is using _res to determine whether we want to convert IPv4
addresses to IPv6 addresses really the right thing to do? */
- int flags = ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0);
+ int flags = (res_use_inet6 () ? AI_V4MAPPED : 0);
while ((status = internal_getent (stream, result, buffer, buflen, errnop,
herrnop, af, flags))
@@ -351,7 +351,7 @@ _nss_files_gethostbyname_r (const char *name, struct hostent *result,
char *buffer, size_t buflen, int *errnop,
int *herrnop)
{
- int af = ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET);
+ int af = (res_use_inet6 () ? AF_INET6 : AF_INET);
return _nss_files_gethostbyname3_r (name, af, result, buffer, buflen,
errnop, herrnop, NULL, NULL);