From b76e065991ec01299225d9da90a627ebe6c1ac97 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 4 Oct 2016 11:52:10 +0200 Subject: resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582] --- resolv/nss_dns/dns-host.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'resolv/nss_dns') diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index c1333b816b..901e037451 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -81,7 +81,8 @@ #include "nsswitch.h" -/* Get implementation for some internal functions. */ +/* Get implementeation for some internal functions. */ +#include #include #include @@ -232,7 +233,7 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result, /* If we are looking for an IPv6 address and mapping is enabled by having the RES_USE_INET6 bit in _res.options set, we try another lookup. */ - if (af == AF_INET6 && (_res.options & RES_USE_INET6)) + if (af == AF_INET6 && res_use_inet6 ()) n = __libc_res_nsearch (&_res, name, C_IN, T_A, host_buffer.buf->buf, host_buffer.buf != orig_host_buffer ? MAXPACKET : 1024, &host_buffer.ptr, @@ -277,7 +278,7 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result, { enum nss_status status = NSS_STATUS_NOTFOUND; - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) status = _nss_dns_gethostbyname3_r (name, AF_INET6, result, buffer, buflen, errnop, h_errnop, NULL, NULL); if (status == NSS_STATUS_NOTFOUND) @@ -503,17 +504,6 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, memcpy (host_data->host_addr, addr, len); host_data->h_addr_ptrs[0] = (char *) host_data->host_addr; host_data->h_addr_ptrs[1] = NULL; -#if 0 - /* XXX I think this is wrong. Why should an IPv4 address be - converted to IPv6 if the user explicitly asked for IPv4? */ - if (af == AF_INET && (_res.options & RES_USE_INET6)) - { - map_v4v6_address ((char *) host_data->host_addr, - (char *) host_data->host_addr); - result->h_addrtype = AF_INET6; - result->h_length = IN6ADDRSZ; - } -#endif *h_errnop = NETDB_SUCCESS; return NSS_STATUS_SUCCESS; } -- cgit v1.2.3-65-gdbad