diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | resolv/nss_dns/dns-host.c | 6 |
3 files changed, 15 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2015-06-22 Andreas Schwab <schwab@suse.de> + + [BZ #18513] + * resolv/nss_dns/dns-host.c (getanswer_r): Record TTL also for + PTR queries. + 2015-06-22 Leonhard Holz <leonhard.holz@web.de> * string/strcoll_l.c (STRCOLL): Remove unnecessary memset. @@ -21,9 +21,9 @@ Version 2.22 18197, 18206, 18210, 18211, 18217, 18220, 18221, 18234, 18244, 18247, 18287, 18319, 18324, 18333, 18346, 18397, 18409, 18410, 18412, 18418, 18422, 18434, 18444, 18468, 18469, 18470, 18479, 18483, 18495, 18496, - 18497, 18498, 18507, 18512, 18519, 18520, 18522, 18527, 18528, 18529, - 18530, 18532, 18533, 18534, 18536, 18539, 18540, 18542, 18544, 18545, - 18546, 18547, 18553, 18558, 18569. + 18497, 18498, 18507, 18512, 18513, 18519, 18520, 18522, 18527, 18528, + 18529, 18530, 18532, 18533, 18534, 18536, 18539, 18540, 18542, 18544, + 18545, 18546, 18547, 18553, 18558, 18569. * Cache information can be queried via sysconf() function on s390 e.g. with _SC_LEVEL1_ICACHE_SIZE as argument. diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index d8c5579..357ac04 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -800,6 +800,10 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, if (qtype == T_PTR && type == T_CNAME) { + /* 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 (__glibc_unlikely (n < 0 || res_dnok (tbuf) == 0)) { @@ -863,6 +867,8 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, ++had_error; break; } + if (ttlp != NULL && ttl < *ttlp) + *ttlp = ttl; /* bind would put multiple PTR records as aliases, but we don't do that. */ result->h_name = bp; |