From: Mark Andrews Date: Tue, 15 Mar 2005 02:48:58 +0000 (+0000) Subject: 1799. [bug] 'rndc flushname' failed to flush negative cache X-Git-Tag: v9.2.6b1~181^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=e90994e3f358bdc6fe03005da08567c807a14c1d;p=thirdparty%2Fbind9.git 1799. [bug] 'rndc flushname' failed to flush negative cache entries. [RT #13438] --- diff --git a/CHANGES b/CHANGES index da745bcd433..6f0768a267d 100644 --- a/CHANGES +++ b/CHANGES @@ -74,7 +74,8 @@ 1800. [bug] Changes #1719 allowed a INSIST to be triggered. [RT #13428] -1799. [placeholder] rt13438 +1799. [bug] 'rndc flushname' failed to flush negative cache + entries. [RT #13438] 1798. [func] The server syntax has been extended to support a range of servers. [RT #11132] diff --git a/lib/dns/cache.c b/lib/dns/cache.c index 8c6450a4aae..b0ee8e201d1 100644 --- a/lib/dns/cache.c +++ b/lib/dns/cache.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: cache.c,v 1.57 2004/03/05 05:09:18 marka Exp $ */ +/* $Id: cache.c,v 1.58 2005/03/15 02:48:58 marka Exp $ */ #include @@ -1021,27 +1021,10 @@ dns_cache_flushname(dns_cache_t *cache, dns_name_t *name) { dns_rdataset_init(&rdataset); dns_rdatasetiter_current(iter, &rdataset); - - for (result = dns_rdataset_first(&rdataset); - result == ISC_R_SUCCESS; - result = dns_rdataset_next(&rdataset)) - { - dns_rdata_t rdata = DNS_RDATA_INIT; - dns_rdatatype_t covers; - - dns_rdataset_current(&rdataset, &rdata); - if (rdata.type == dns_rdatatype_rrsig) - covers = dns_rdata_covers(&rdata); - else - covers = 0; - result = dns_db_deleterdataset(cache->db, node, NULL, - rdata.type, covers); - if (result != ISC_R_SUCCESS && - result != DNS_R_UNCHANGED) - break; - } + result = dns_db_deleterdataset(cache->db, node, NULL, + rdataset.type, rdataset.covers); dns_rdataset_disassociate(&rdataset); - if (result != ISC_R_NOMORE) + if (result != ISC_R_SUCCESS && result != DNS_R_UNCHANGED) break; } if (result == ISC_R_NOMORE)