GNU C Library master sources branch, master, updated. glibc-2.11-326-g4535680

drepper@sourceware.org drepper@sourceware.org
Mon Apr 5 19:22:00 GMT 2010


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  4535680d03d15dc9ce19d97b9d242a10941d5016 (commit)
      from  4bc2bcba67e870778fb9397f29435ee1b66bebf3 (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4535680d03d15dc9ce19d97b9d242a10941d5016

commit 4535680d03d15dc9ce19d97b9d242a10941d5016
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Mon Apr 5 12:21:20 2010 -0700

    Handle DNS timeouts in old-style lookkup code.

diff --git a/ChangeLog b/ChangeLog
index 866ec65..cecad61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-05  Ulrich Drepper  <drepper@redhat.com>
 
+	[BZ #11010]
+	* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Handle
+	timeouts from servers.
+
 	[BZ #11149]
 	* elf/ldconfig.c (main): Respect chroot setting when looking for
 	the aux cache.
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index 818a40a..e0c4978 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2004, 2007-2009, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -198,21 +198,27 @@ _nss_dns_gethostbyname3_r (const char *name, int af, struct hostent *result,
 			  1024, &host_buffer.ptr, NULL, NULL, NULL);
   if (n < 0)
     {
-      if (errno == ESRCH)
+      switch (errno)
 	{
+	case ESRCH:
 	  status = NSS_STATUS_TRYAGAIN;
 	  h_errno = TRY_AGAIN;
+	  break;
+	case ECONNREFUSED:
+	case ETIMEDOUT:
+	  status = NSS_STATUS_UNAVAIL;
+	  break;
+	default:
+	  status = NSS_STATUS_NOTFOUND;
+	  break;
 	}
-      else
-	status = (errno == ECONNREFUSED
-		  ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
       *h_errnop = h_errno;
       if (h_errno == TRY_AGAIN)
 	*errnop = EAGAIN;
       else
 	__set_errno (olderr);
 
-      /* If we are looking for a IPv6 address and mapping is enabled
+      /* 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))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |    4 ++++
 resolv/nss_dns/dns-host.c |   18 ++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list