diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2018-03-29 19:44:36 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2018-03-29 19:44:36 +0000 |
commit | 1b1964c6f5e29b3ca1029bc0c13ec38ef6e141d2 (patch) | |
tree | fd2d75db1aaf6e6ae2e2fe65e23620bd8367dfa9 /usr.sbin/unbound/edns-subnet | |
parent | b9208b783d9ed6c47ca4391b1fae9210d632c1db (diff) |
update to unbound 1.7.0
testing tb, sthen
OK benno, sthen
Diffstat (limited to 'usr.sbin/unbound/edns-subnet')
-rw-r--r-- | usr.sbin/unbound/edns-subnet/addrtree.c | 2 | ||||
-rw-r--r-- | usr.sbin/unbound/edns-subnet/subnetmod.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/unbound/edns-subnet/addrtree.c b/usr.sbin/unbound/edns-subnet/addrtree.c index 050eb31fc98..9a02db062c5 100644 --- a/usr.sbin/unbound/edns-subnet/addrtree.c +++ b/usr.sbin/unbound/edns-subnet/addrtree.c @@ -485,7 +485,7 @@ addrtree_find(struct addrtree *tree, const addrkey_t *addr, /* does this node have data? if yes, see if we have a match */ if (node->elem && node->ttl >= now) { /* saved at wrong depth */; - log_assert(node->scope >= depth) + log_assert(node->scope >= depth); if (depth == node->scope || (node->scope > sourcemask && depth == sourcemask)) { diff --git a/usr.sbin/unbound/edns-subnet/subnetmod.c b/usr.sbin/unbound/edns-subnet/subnetmod.c index 4b8a4b21127..ae2523b86c2 100644 --- a/usr.sbin/unbound/edns-subnet/subnetmod.c +++ b/usr.sbin/unbound/edns-subnet/subnetmod.c @@ -339,6 +339,7 @@ update_cache(struct module_qstate *qstate, int id) return; } lru_entry = &mrep_entry->entry; + lock_rw_wrlock(&lru_entry->lock); lru_entry->data = calloc(1, sizeof(struct subnet_msg_cache_data)); if (!lru_entry->data) { @@ -352,7 +353,9 @@ update_cache(struct module_qstate *qstate, int id) log_err("Subnet cache insertion failed"); return; } + lock_quick_lock(&sne->alloc.lock); rep = reply_info_copy(qstate->return_msg->rep, &sne->alloc, NULL); + lock_quick_unlock(&sne->alloc.lock); if (!rep) { if (acquired_lock) lock_rw_unlock(&lru_entry->lock); log_err("Subnet cache insertion failed"); @@ -374,6 +377,7 @@ update_cache(struct module_qstate *qstate, int id) if (acquired_lock) { lock_rw_unlock(&lru_entry->lock); } else { + lock_rw_unlock(&lru_entry->lock); slabhash_insert(subnet_msg_cache, h, lru_entry, lru_entry->data, NULL); } |