This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.19-733-g76985d3
- From: siddhesh at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 1 Jul 2014 11:52:50 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.19-733-g76985d3
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 76985d3e036ea3519641003b4ab72d53ec496910 (commit)
from b0cb309635f43aa269dba0ea9925ced294926546 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=76985d3e036ea3519641003b4ab72d53ec496910
commit 76985d3e036ea3519641003b4ab72d53ec496910
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Tue Jul 1 14:14:09 2014 +0530
Remove MULTI_PTRS_ARE_ALIASES in dns-hosts.c
The code in gethnamaddr.c for gethostbyaddr used and set this macro to
allow multiple PTR records to be added as aliases. This was useful
for gethostbyaddr since it returns a hostent structure, which can
return aliases.
The gethnamaddr.c source however is unused in glibc since pretty much
forever. Instead, the DNS lookup bits for gethostbyaddr (as well as
getnameinfo) are implemented in dns-hosts.c and in that implementation
all but one (the first one) of the multiple PTR records are ignored.
Since gethnamaddr.c is essentially dead code, ignore that
implementation and replace the MULTI_PTRS_ARE_ALIASES bit with a
comment mentioning that bind adds PTR records as aliases while we
don't.
diff --git a/ChangeLog b/ChangeLog
index 3ac4f45..3619d64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-01 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * resolv/nss_dns/dns-host.c (getanswer_r)
+ [MULTI_PTRS_ARE_ALIASES]: Remove code.
+
2014-07-01 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index a5f2c0a..3258e70 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -869,27 +869,8 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
++had_error;
break;
}
-#if MULTI_PTRS_ARE_ALIASES
- cp += n;
- if (haveanswer == 0)
- result->h_name = bp;
- else if (ap < &host_data->aliases[MAXALIASES-1])
- *ap++ = bp;
- else
- n = -1;
- if (n != -1)
- {
- n = strlen (bp) + 1; /* for the \0 */
- if (__builtin_expect (n, 0) >= MAXHOSTNAMELEN)
- {
- ++had_error;
- break;
- }
- bp += n;
- linebuflen -= n;
- }
- break;
-#else
+ /* bind would put multiple PTR records as aliases, but we don't do
+ that. */
result->h_name = bp;
if (have_to_map)
{
@@ -906,7 +887,6 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
}
*h_errnop = NETDB_SUCCESS;
return NSS_STATUS_SUCCESS;
-#endif
case T_A:
case T_AAAA:
if (__builtin_expect (strcasecmp (result->h_name, bp), 0) != 0)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
resolv/nss_dns/dns-host.c | 24 ++----------------------
2 files changed, 7 insertions(+), 22 deletions(-)
hooks/post-receive
--
GNU C Library master sources