]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #4144: dns64 module caches wrong (negative) information.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 10 Aug 2018 08:03:17 +0000 (08:03 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 10 Aug 2018 08:03:17 +0000 (08:03 +0000)
git-svn-id: file:///svn/unbound/trunk@4850 be551aaa-1e26-0410-a405-d3ace91eadb9

dns64/dns64.c
doc/Changelog
services/cache/dns.c
services/cache/dns.h

index c2b9bd0d84a803a31bdb648c03ecbaa13cde9587..2d1fcc88b1ba5fbf1996592786d12a7e1bb8ffe5 100644 (file)
@@ -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,
index 51974ea8e24a6f6a7bc220ac5cf07e996849a59c..7f5c0e88c50ac53a8b0cf6e0cea6cc05a5888ee0 100644 (file)
@@ -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.
index 35adc35b57ee515eacc269e931e5720a915099ea..52b9ff0131b559951ff2106db9b81bb325d1ce2a 100644 (file)
@@ -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)
 {
index 78f81e79952250b0414c4d5ec4b9e651e70bfadd..19d0d9f992d1a6c266284039c5dcbbf8c2a93a60 100644 (file)
@@ -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 */