From: Wouter Wijngaards Date: Fri, 10 Aug 2018 08:03:17 +0000 (+0000) Subject: - Fix #4144: dns64 module caches wrong (negative) information. X-Git-Tag: release-1.8.0rc1~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efe5c8e6be4cadc75fa4a68f84a7cd1b530a2019;p=thirdparty%2Funbound.git - Fix #4144: dns64 module caches wrong (negative) information. git-svn-id: file:///svn/unbound/trunk@4850 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/dns64/dns64.c b/dns64/dns64.c index c2b9bd0d8..2d1fcc88b 100644 --- a/dns64/dns64.c +++ b/dns64/dns64.c @@ -809,6 +809,12 @@ dns64_adjust_a(int id, struct module_qstate* super, struct module_qstate* qstate rrset_cache_remove(super->env->rrset_cache, dk->rk.dname, dk->rk.dname_len, LDNS_RR_TYPE_AAAA, LDNS_RR_CLASS_IN, 0); + /* Delete negative AAAA in msg cache for CNAMEs, + * stored by the iterator module */ + if(i != 0) /* if not the first RR */ + msg_cache_remove(super->env, dk->rk.dname, + dk->rk.dname_len, LDNS_RR_TYPE_AAAA, + LDNS_RR_CLASS_IN, 0); } else { dk->entry.hash = fk->entry.hash; dk->rk.dname = (uint8_t*)regional_alloc_init(super->region, diff --git a/doc/Changelog b/doc/Changelog index 51974ea8e..7f5c0e88c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +10 August 2018: Wouter + - Fix #4144: dns64 module caches wrong (negative) information. + 9 August 2018: Wouter - unbound-checkconf checks if modules exist and prints if they are not compiled in the name of the wrong module. diff --git a/services/cache/dns.c b/services/cache/dns.c index 35adc35b5..52b9ff013 100644 --- a/services/cache/dns.c +++ b/services/cache/dns.c @@ -109,7 +109,7 @@ store_rrsets(struct module_env* env, struct reply_info* rep, time_t now, } /** delete message from message cache */ -static void +void msg_cache_remove(struct module_env* env, uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags) { diff --git a/services/cache/dns.h b/services/cache/dns.h index 78f81e799..19d0d9f99 100644 --- a/services/cache/dns.h +++ b/services/cache/dns.h @@ -238,4 +238,16 @@ struct msgreply_entry* msg_cache_lookup(struct module_env* env, uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, uint16_t flags, time_t now, int wr); +/** + * Remove entry from the message cache. For unwanted entries. + * @param env: with message cache. + * @param qname: query name, in wireformat + * @param qnamelen: length of qname, including terminating 0. + * @param qtype: query type, host order. + * @param qclass: query class, host order. + * @param flags: flags + */ +void msg_cache_remove(struct module_env* env, uint8_t* qname, size_t qnamelen, + uint16_t qtype, uint16_t qclass, uint16_t flags); + #endif /* SERVICES_CACHE_DNS_H */