This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.15-531-g48c41d0


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  48c41d04ee06efc6ec97325ed6697c121b40865f (commit)
      from  2f5a5ed02c346e5debc89b82a7c7e0eacc37a107 (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=48c41d04ee06efc6ec97325ed6697c121b40865f

commit 48c41d04ee06efc6ec97325ed6697c121b40865f
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Mar 30 20:58:14 2012 +0530

    Consider TTL of CNAME record and return minimum TTL in the chain
    
    [BZ #13928] A DNS request consists of multiple resources combined into
    a single hostent, including multiple CNAME records that may have been
    assigned different TTL values. In such a case, nscd should take the
    least TTL among all of the resources as the timeout for the hostent
    before it is reloaded in its cache so that the hostent remains stale
    in the database for the least amount of time.

diff --git a/ChangeLog b/ChangeLog
index b38246e..2e16f98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-30  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	[BZ #13928]
+	* resolv/nss_dns/dns-host.c (getanswer_r): Also consider ttl
+	from a CNAME entry and return the minimum ttl for the query.
+	(gaih_getanswer_slice): Likewise.
+
 2012-03-30  Jeff Law  <law@redhat.com>
 
 	* crypt/md5-crypt.c (__md5_crypt_r): Avoid unbounded alloca uses
diff --git a/NEWS b/NEWS
index 93432bf..5489c97 100644
--- a/NEWS
+++ b/NEWS
@@ -18,7 +18,7 @@ Version 2.16
   13618, 13637, 13656, 13658, 13673, 13691, 13695, 13704, 13706, 13726,
   13738, 13760, 13761, 13786, 13792, 13806, 13824, 13840, 13841, 13844,
   13846, 13851, 13852, 13854, 13871, 13879, 13883, 13892, 13910, 13911,
-  13912, 13913, 13915, 13916, 13917, 13918, 13919, 13920, 13921
+  13912, 13913, 13915, 13916, 13917, 13918, 13919, 13920, 13921, 13928
 
 * ISO C11 support:
 
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index 3b287b7..ba83c44 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004, 2007-2009, 2010, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2004, 2007-2010, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -744,6 +744,10 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
 
       if ((qtype == T_A || qtype == T_AAAA) && type == T_CNAME)
 	{
+	  /* A CNAME could also have a TTL entry.  */
+	  if (ttlp != NULL && ttl < *ttlp)
+	      *ttlp = ttl;
+
 	  if (ap >= &host_data->aliases[MAX_NR_ALIASES - 1])
 	    continue;
 	  n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf);
@@ -905,7 +909,10 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
 	    {
 	      register int nn;
 
-	      if (ttlp != NULL)
+	      /* We compose a single hostent out of the entire chain of
+	         entries, so the TTL of the hostent is essentially the lowest
+		 TTL in the chain.  */
+	      if (ttlp != NULL && ttl < *ttlp)
 		*ttlp = ttl;
 	      if (canonp != NULL)
 		*canonp = bp;
@@ -1081,6 +1088,11 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
       if (type == T_CNAME)
 	{
 	  char tbuf[MAXDNAME];
+
+	  /* A CNAME could also have a TTL entry.  */
+	  if (ttlp != NULL && ttl < *ttlp)
+	      *ttlp = ttl;
+
 	  n = dn_expand (answer->buf, end_of_message, cp, tbuf, sizeof tbuf);
 	  if (__builtin_expect (n < 0 || res_hnok (tbuf) == 0, 0))
 	    {
@@ -1161,7 +1173,10 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
 
       if (*firstp)
 	{
-	  if (ttlp != NULL)
+	  /* We compose a single hostent out of the entire chain of
+	     entries, so the TTL of the hostent is essentially the lowest
+	     TTL in the chain.  */
+	  if (ttlp != NULL && ttl < *ttlp)
 	    *ttlp = ttl;
 
 	  (*pat)->name = canon ?: h_name;

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

Summary of changes:
 ChangeLog                 |    7 +++++++
 NEWS                      |    2 +-
 resolv/nss_dns/dns-host.c |   21 ++++++++++++++++++---
 3 files changed, 26 insertions(+), 4 deletions(-)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]