From patchwork Fri Sep 9 14:40:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 668097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sW0J75409z9ryT for ; Sat, 10 Sep 2016 00:41:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=wJ8e75tD; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= jvqXh3WKGuyHvoZ9RmYWUj8cP95ojns+hmW6URujFX6hb6IxEjgAUp3kxf60FW1F EmdBNjFHQmYkHQYrGbuEXBr0y3hikL3uogcx0BxsQcUBBitByqrktFtIgMzAC5IO 1x/uGhH/PXfrrMTcOHPMqdUFTNEJ/HdS5NeFQXQ7Iqs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=8vtUIh BG5QtxKXnp9SSftdXIpMI=; b=wJ8e75tDa4Tl/z7w61ILIBGWMSTGLgYG2I+DjB sHL0W+eJzfMwVQ5q1q/2iyRD48Jpvh0ZPPIAhCc9gwskVhK0zicGPlkVQaLQG6Fk UC+CsOR9itUTCr4CzKjIRB5L8UgXH4BYK5qaAE9jplIZUg1DW1eolqxEkPEMIAaZ gR/mA= Received: (qmail 98048 invoked by alias); 9 Sep 2016 14:41:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 96852 invoked by uid 89); 9 Sep 2016 14:40:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=ipv6, IPv6, influenced, 4097 X-HELO: mx1.redhat.com Date: Fri, 09 Sep 2016 16:40:45 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] resolv: Deprecate the "inet6" option and RES_USE_INET6 [BZ #19582] User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20160909144045.38F43401494C7@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2016-09-09 Florian Weimer [BZ #19582] Deprecate RES_USE_INET6. * misc/sys/cdefs.h (__glibc_macro_warning1) (__glibc_macro_warning): Define. * nis/nss_nis/nis-hosts.c (_nss_nis_gethostent_r) (_nss_nis_gethostbyname2_r, _nss_nis_gethostbyname_r) (_nss_nis_gethostbyaddr_r): Use res_use_inet6 instead of RES_USE_INET6. * nis/nss_nisplus/nisplus-hosts.c (internal_nisplus_gethostent_r) (_nss_nisplus_gethostbyname2_r, _nss_nisplus_gethostbyname_r) (_nss_nisplus_gethostbyaddr_r): Likewise. * nscd/aicache.c (addhstaiX): Use DEPRECATED_RES_USE_INET6 instead of res_use_inet6. * nscd/nscd_gethst_r.c (__nscd_gethostbyname_r): Use res_use_inet6 instead of RES_USE_INET6. * nss/digits_dots.c (__nss_hostname_digits_dots): Likewise. * nss/nss_files/files-hosts.c (EXTRA_ARGS_VALUE) (_nss_files_gethostbyname3_r, _nss_files_gethostbyname_r): Likewise. * resolv/gethnamaddr.c (getanswer, gethostbyname, gethostbyname2) (gethostbyaddr, _gethtent, _gethtbyname): Likewise. * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r) (_nss_dns_gethostbyname_r, _nss_dns_gethostbyaddr2_r): Likewise. * resolv/res_debug.c (p_option): Use DEPRECATED_RES_USE_INET6 instead of RES_USE_INET6. * resolv/res_init.c (res_setoptions): Likewise. * resolv/resolv-internal.h: New file. * resolv/resolv.h (RES_USE_INET6): Mark as deprecated. * resolv/README (Using the resolver in multi-threaded code): Drop reference to RES_USE_INET6. * sysdeps/posix/getaddrinfo.c (gethosts, gaih_inet): Use DEPRECATED_RES_USE_INET6 instead of res_use_inet6. diff --git a/NEWS b/NEWS index ba1ec71..e01e941 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,11 @@ Version 2.25 for the Linux quota interface which predates kernel version 2.4.22 has been removed. +* The "inet6" option in /etc/resolv.conf and the RES_USE_INET6 flag for + _res.flags are deprecated. The flag was standardized in RFC 2133 with a + different meaning (making its behavior non-portable), and removed from the + standard in RFC 2553. Applications should use getaddrinfo instead. + Security related changes: On ARM EABI (32-bit), generating a backtrace for execution contexts which diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 6e9b840..04b8b68 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -466,4 +466,12 @@ # endif #endif +#if __GNUC_PREREQ (4,8) +# define __glibc_macro_warning1(message) _Pragma (#message)) +# define __glibc_macro_warning(message) \ + __glibc_macro_warning1 (GCC warning message) +#else +# define __glibc_macro_warning(msg) +#endif + #endif /* sys/cdefs.h */ diff --git a/nis/nss_nis/nis-hosts.c b/nis/nss_nis/nis-hosts.c index d266cf2..a337797 100644 --- a/nis/nss_nis/nis-hosts.c +++ b/nis/nss_nis/nis-hosts.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -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) diff --git a/nis/nss_nisplus/nisplus-hosts.c b/nis/nss_nisplus/nisplus-hosts.c index 2751e59..97a03aa 100644 --- a/nis/nss_nisplus/nisplus-hosts.c +++ b/nis/nss_nisplus/nisplus-hosts.c @@ -43,6 +43,7 @@ static u_long tablename_len; (NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len) /* Get implementation for some internal functions. */ +#include #include @@ -321,7 +322,7 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer, } } - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) parse_res = _nss_nisplus_parse_hostent (result, AF_INET6, host, buffer, buflen, errnop, AI_V4MAPPED); else @@ -488,7 +489,7 @@ _nss_nisplus_gethostbyname2_r (const char *name, int af, struct hostent *host, return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop, herrnop, - ((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0)); + (res_use_inet6 () ? AI_V4MAPPED : 0)); } @@ -497,7 +498,7 @@ _nss_nisplus_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; @@ -558,7 +559,7 @@ _nss_nisplus_gethostbyaddr_r (const void *addr, socklen_t addrlen, int af, parse_res = _nss_nisplus_parse_hostent (result, af, host, buffer, buflen, errnop, - ((_res.options & RES_USE_INET6) + (res_use_inet6 () ? AI_V4MAPPED : 0)); nis_freeresult (result); diff --git a/nscd/aicache.c b/nscd/aicache.c index 32c8f57..f955be7 100644 --- a/nscd/aicache.c +++ b/nscd/aicache.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include "dbg_log.h" @@ -110,7 +111,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, IPv6 addresses. Currently this is decided by setting the RES_USE_INET6 bit in _res.options. */ int old_res_options = _res.options; - _res.options &= ~RES_USE_INET6; + _res.options &= ~DEPRECATED_RES_USE_INET6; size_t tmpbuf6len = 1024; char *tmpbuf6 = alloca (tmpbuf6len); @@ -535,7 +536,7 @@ next_nip: } out: - _res.options |= old_res_options & RES_USE_INET6; + _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; if (dataset != NULL && !alloca_used) { diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c index 7448add..820a2fe 100644 --- a/nscd/nscd_gethst_r.c +++ b/nscd/nscd_gethst_r.c @@ -17,7 +17,7 @@ . */ #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ __nscd_gethostbyname_r (const char *name, struct hostent *resultbuf, { request_type reqtype; - reqtype = (_res.options & RES_USE_INET6) ? GETHOSTBYNAMEv6 : GETHOSTBYNAME; + reqtype = res_use_inet6 () ? GETHOSTBYNAMEv6 : GETHOSTBYNAME; return nscd_gethst_r (name, strlen (name) + 1, reqtype, resultbuf, buffer, buflen, result, h_errnop); diff --git a/nss/digits_dots.c b/nss/digits_dots.c index 57f0e4d..14f5b56 100644 --- a/nss/digits_dots.c +++ b/nss/digits_dots.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #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 2a4a665..8f330b1 100644 --- a/nss/nss_files/files-hosts.c +++ b/nss/nss_files/files-hosts.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include /* 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); diff --git a/resolv/README b/resolv/README index 17aa631..c500251 100644 --- a/resolv/README +++ b/resolv/README @@ -80,11 +80,7 @@ code: * In Multi-threaded that manipulate the _res structure, calls to functions like `gethostbyname' in threads other than the "main" - thread won't be influenced by the those changes anymore. So if you - set RES_USE_INET6, a call to `gethostbyname' won't return any IPv6 - hosts anymore. If you recompile such programs, manipulating the - _res structure will affect the thread in which you do so instead of - the "main" thread. + thread won't be influenced by the those changes anymore. We recommend to use the new thread-safe interfaces in new code, since the traditional interfaces have been deprecated by the BIND folks. diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c index 9ad2c30..ef8aaba 100644 --- a/resolv/gethnamaddr.c +++ b/resolv/gethnamaddr.c @@ -63,7 +63,7 @@ #include #include -#include +#include #include #include #include @@ -409,7 +409,7 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) bp += n; buflen -= n; } - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) map_v4v6_hostent(&host, &bp, &buflen); __set_h_errno (NETDB_SUCCESS); return (&host); @@ -431,7 +431,7 @@ gethostbyname (const char *name) __set_h_errno (NETDB_INTERNAL); return (NULL); } - if (_res.options & RES_USE_INET6) { + if (res_use_inet6 ()) { hp = gethostbyname2(name, AF_INET6); if (hp) return (hp); @@ -512,7 +512,7 @@ gethostbyname2 (const char *name, int af) h_addr_ptrs[0] = (char *)host_addr; h_addr_ptrs[1] = NULL; host.h_addr_list = h_addr_ptrs; - if (_res.options & RES_USE_INET6) + if (res_use_inet6 ()) map_v4v6_hostent(&host, &bp, &len); __set_h_errno (NETDB_SUCCESS); return (&host); @@ -666,7 +666,7 @@ gethostbyaddr (const void *addr, socklen_t len, int af) memmove(host_addr, addr, len); h_addr_ptrs[0] = (char *)host_addr; h_addr_ptrs[1] = NULL; - if (af == AF_INET && (_res.options & RES_USE_INET6)) { + if (af == AF_INET && res_use_inet6 ()) { map_v4v6_address((char*)host_addr, (char*)host_addr); hp->h_addrtype = AF_INET6; hp->h_length = IN6ADDRSZ; @@ -723,7 +723,7 @@ _gethtent (void) af = AF_INET6; len = IN6ADDRSZ; } else if (inet_pton(AF_INET, p, host_addr) > 0) { - if (_res.options & RES_USE_INET6) { + if (res_use_inet6 ()) { map_v4v6_address((char*)host_addr, (char*)host_addr); af = AF_INET6; len = IN6ADDRSZ; @@ -766,7 +766,7 @@ _gethtbyname (const char *name) { struct hostent *hp; - if (_res.options & RES_USE_INET6) { + if (res_use_inet6 ()) { hp = _gethtbyname2(name, AF_INET6); if (hp) return (hp); diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index 5f9e357..69f8d04 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) @@ -528,7 +529,7 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af, #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)) + if (af == AF_INET && res_use_inet6 ()) { map_v4v6_address ((char *) host_data->host_addr, (char *) host_data->host_addr); diff --git a/resolv/res_debug.c b/resolv/res_debug.c index bd95590..4135be0 100644 --- a/resolv/res_debug.c +++ b/resolv/res_debug.c @@ -101,7 +101,7 @@ #include #include #include -#include +#include #include #include #include @@ -575,7 +575,7 @@ p_option(u_long option) { case RES_INSECURE1: return "insecure1"; case RES_INSECURE2: return "insecure2"; case RES_NOALIASES: return "noaliases"; - case RES_USE_INET6: return "inet6"; + case DEPRECATED_RES_USE_INET6: return "inet6"; case RES_ROTATE: return "rotate"; case RES_NOCHECKNAME: return "no-check-names(unimpl)"; case RES_KEEPTSIG: return "keeptsig(unimpl)"; diff --git a/resolv/res_init.c b/resolv/res_init.c index cea4c8a..064211e 100644 --- a/resolv/res_init.c +++ b/resolv/res_init.c @@ -66,7 +66,7 @@ #include #include -#include +#include #include #include #include @@ -450,7 +450,7 @@ res_setoptions(res_state statp, const char *options, const char *source) { unsigned long int flag; } options[] = { #define STRnLEN(str) str, sizeof (str) - 1 - { STRnLEN ("inet6"), 0, RES_USE_INET6 }, + { STRnLEN ("inet6"), 0, DEPRECATED_RES_USE_INET6 }, { STRnLEN ("ip6-bytestring"), 0, RES_USEBSTRING }, { STRnLEN ("no-ip6-dotint"), 0, RES_NOIP6DOTINT }, { STRnLEN ("ip6-dotint"), 1, ~RES_NOIP6DOTINT }, diff --git a/resolv/resolv-internal.h b/resolv/resolv-internal.h new file mode 100644 index 0000000..269758c --- /dev/null +++ b/resolv/resolv-internal.h @@ -0,0 +1,35 @@ +/* libresolv interfaces for internal use across glibc. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _RESOLV_INTERNAL_H +#define _RESOLV_INTERNAL_H 1 + +#include +#include + +/* Internal version of RES_USE_INET6 which does not trigger a + deprecation warning. */ +#define DEPRECATED_RES_USE_INET6 0x00002000 + +static inline bool +res_use_inet6 (void) +{ + return _res.options & DEPRECATED_RES_USE_INET6; +} + +#endif /* _RESOLV_INTERNAL_H */ diff --git a/resolv/resolv.h b/resolv/resolv.h index f55e7ce..5a66265 100644 --- a/resolv/resolv.h +++ b/resolv/resolv.h @@ -205,7 +205,8 @@ struct res_sym { #define RES_INSECURE1 0x00000400 /* type 1 security disabled */ #define RES_INSECURE2 0x00000800 /* type 2 security disabled */ #define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */ -#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */ +#define RES_USE_INET6 \ + __glibc_macro_warning ("RES_USE_INET6 is deprecated") 0x00002000 #define RES_ROTATE 0x00004000 /* rotate ns list after each query */ #define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity (!IMPL) */ #define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */ diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 09fbc83..fb51c07 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -59,7 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include +#include #include #include #include @@ -266,7 +266,7 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req, if (herrno == NETDB_INTERNAL) \ { \ __set_h_errno (herrno); \ - _res.options |= old_res_options & RES_USE_INET6; \ + _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; \ result = -EAI_SYSTEM; \ goto free_and_return; \ } \ @@ -282,7 +282,7 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req, addrmem = NULL; \ if (!convert_hostent_to_gaih_addrtuple (req, _family,h, &addrmem)) \ { \ - _res.options |= old_res_options & RES_USE_INET6; \ + _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; \ result = -EAI_SYSTEM; \ goto free_and_return; \ } \ @@ -825,7 +825,7 @@ gaih_inet (const char *name, const struct gaih_service *service, addresses to IPv6 addresses. Currently this is decided by setting the RES_USE_INET6 bit in _res.options. */ old_res_options = _res.options; - _res.options &= ~RES_USE_INET6; + _res.options &= ~DEPRECATED_RES_USE_INET6; while (!no_more) { @@ -862,7 +862,8 @@ gaih_inet (const char *name, const struct gaih_service *service, if (!scratch_buffer_grow (tmpbuf)) { - _res.options |= old_res_options & RES_USE_INET6; + _res.options + |= old_res_options & DEPRECATED_RES_USE_INET6; result = -EAI_MEMORY; goto free_and_return; } @@ -979,7 +980,8 @@ gaih_inet (const char *name, const struct gaih_service *service, if (canonbuf == NULL) { _res.options - |= old_res_options & RES_USE_INET6; + |= old_res_options + & DEPRECATED_RES_USE_INET6; result = -EAI_MEMORY; goto free_and_return; } @@ -1041,7 +1043,7 @@ gaih_inet (const char *name, const struct gaih_service *service, nip = nip->next; } - _res.options |= old_res_options & RES_USE_INET6; + _res.options |= old_res_options & DEPRECATED_RES_USE_INET6; if (h_errno == NETDB_INTERNAL) {