]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Tue, 8 Aug 2000 01:10:25 +0000 (01:10 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 8 Aug 2000 01:10:25 +0000 (01:10 +0000)
 374.   [bug]           SOA in authoritative negative responses had wrong TTL.

CHANGES
bin/named/query.c

diff --git a/CHANGES b/CHANGES
index c1ef686550ba8b5e17bb56a581dcd1d546dfe1f1..f19639ff5d2add187be77a8d0db9f1043381a833 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
 
        --- 9.0.0rc2 released ---
 
+ 374.  [bug]           SOA in authoritative negative responses had wrong TTL.
+
  373.  [func]          nslookup is now installed by "make install".
 
  372.  [bug]           Deal with Microsoft DNS servers appending two bytes of
index cb3194699b29f20e7383608b856797809f2db35b..a5fe9aacd12531ae6a4b7a81a5f3555712b95e74 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: query.c,v 1.109.2.7 2000/07/28 17:48:56 gson Exp $ */
+/* $Id: query.c,v 1.109.2.8 2000/08/08 01:10:25 gson Exp $ */
 
 #include <config.h>
 
@@ -29,6 +29,7 @@
 #include <dns/rdatalist.h>
 #include <dns/rdataset.h>
 #include <dns/rdatasetiter.h>
+#include <dns/rdatastruct.h>
 #include <dns/rdatatype.h>
 #include <dns/resolver.h>
 #include <dns/result.h>
@@ -1425,6 +1426,24 @@ query_addsoa(ns_client_t *client, dns_db_t *db) {
                 */
                eresult = DNS_R_SERVFAIL;
        } else {
+               /*
+                * Extract the SOA MINIMUM.
+                */
+               dns_rdata_soa_t soa;
+               dns_rdata_t rdata;
+               result = dns_rdataset_first(rdataset);
+               RUNTIME_CHECK(result == ISC_R_SUCCESS);
+               dns_rdataset_current(rdataset, &rdata);
+               dns_rdata_tostruct(&rdata, &soa, NULL);
+
+               /*
+                * Add the SOA and its SIG to the response, with the
+                * TTLs adjusted per RFC2308 section 3.
+                */
+               if (rdataset->ttl > soa.minimum)
+                       rdataset->ttl = soa.minimum;
+               if (sigrdataset->ttl > soa.minimum)
+                       sigrdataset->ttl = soa.minimum;
                query_addrrset(client, &name, &rdataset, &sigrdataset, NULL,
                               DNS_SECTION_AUTHORITY);
        }