From 59f5480df1ff0a32704498a11f8e8df1967921bf Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 30 Jun 2011 11:01:44 +0000 Subject: [PATCH] - fix replyaddr count wrong after jostled queries, which leads to 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 | 2 ++ services/mesh.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index ab1823ef2..57760e1ec 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/services/mesh.c b/services/mesh.c index 660c1fd76..4821b941f 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -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; imods.num; i++) { fptr_ok(fptr_whitelist_mod_clear(mesh->mods.mod[i]->clear)); (*mesh->mods.mod[i]->clear)(&mstate->s, i); -- 2.47.2