]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- fix replyaddr count wrong after jostled queries, which leads to
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 30 Jun 2011 11:01:44 +0000 (11:01 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 30 Jun 2011 11:01:44 +0000 (11:01 +0000)
  eventual starvation where the daemon has no replyaddrs left to use.

git-svn-id: file:///svn/unbound/trunk@2445 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/mesh.c

index ab1823ef236acc77e905aaeebd6ab3407328a32d..57760e1ec391001288073ca47105bbc8d84afe15 100644 (file)
@@ -2,6 +2,8 @@
        - tag relase 1.4.11, trunk is 1.4.12 development.
        - iana portlist updated.
        - fix bug#395: id bits of other query may leak out under conditions
+       - fix replyaddr count wrong after jostled queries, which leads to
+         eventual starvation where the daemon has no replyaddrs left to use.
 
 23 June 2011: Wouter
        - Changed -flto check to support clang compiler.
index 660c1fd76d9d025fb4c8d936e6ee8f6cce63fc92..4821b941f4f124fdc0f445f695b44d84fcd2346b 100644 (file)
@@ -528,22 +528,24 @@ mesh_state_cleanup(struct mesh_state* mstate)
        int i;
        if(!mstate)
                return;
+       mesh = mstate->s.env->mesh;
        /* drop unsent replies */
        if(!mstate->replies_sent) {
                struct mesh_reply* rep;
                struct mesh_cb* cb;
                for(rep=mstate->reply_list; rep; rep=rep->next) {
                        comm_point_drop_reply(&rep->query_reply);
+                       mesh->num_reply_addrs--;
                }
                for(cb=mstate->cb_list; cb; cb=cb->next) {
                        fptr_ok(fptr_whitelist_mesh_cb(cb->cb));
                        (*cb->cb)(cb->cb_arg, LDNS_RCODE_SERVFAIL, NULL,
                                sec_status_unchecked, NULL);
+                       mesh->num_reply_addrs--;
                }
        }
 
        /* de-init modules */
-       mesh = mstate->s.env->mesh;
        for(i=0; i<mesh->mods.num; i++) {
                fptr_ok(fptr_whitelist_mod_clear(mesh->mods.mod[i]->clear));
                (*mesh->mods.mod[i]->clear)(&mstate->s, i);