From: W.C.A. Wijngaards Date: Mon, 20 Apr 2020 12:24:05 +0000 (+0200) Subject: - Fix for count of reply states in the mesh. X-Git-Tag: release-1.11.0~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00323b71d7142561d5ef46522dd03a771202c8c3;p=thirdparty%2Funbound.git - Fix for count of reply states in the mesh. --- diff --git a/doc/Changelog b/doc/Changelog index 1e43d5085..4b32207cd 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 20 April 2020: Wouter - Fix #222: --enable-rpath, fails to rpath python lib. + - Fix for count of reply states in the mesh. 17 April 2020: George - Add SNI support on more TLS connections (fixes #193). diff --git a/services/mesh.c b/services/mesh.c index 09c51a2be..f484df934 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -1810,6 +1810,7 @@ void mesh_list_remove(struct mesh_state* m, struct mesh_state** fp, void mesh_state_remove_reply(struct mesh_area* mesh, struct mesh_state* m, struct comm_point* cp) { + int was_mesh_reply = 0; struct mesh_reply* n, *prev = NULL; n = m->reply_list; /* when in mesh_cleanup, it sets the reply_list to NULL, so that @@ -1823,6 +1824,7 @@ void mesh_state_remove_reply(struct mesh_area* mesh, struct mesh_state* m, /* delete it, but allocated in m region */ log_assert(mesh->num_reply_addrs > 0); mesh->num_reply_addrs--; + was_mesh_reply = 1; /* prev = prev; */ n = n->next; @@ -1837,7 +1839,7 @@ void mesh_state_remove_reply(struct mesh_area* mesh, struct mesh_state* m, mesh->num_detached_states++; } /* if not replies any more in mstate, it is no longer a reply_state */ - if(!m->reply_list && !m->cb_list) { + if(!m->reply_list && !m->cb_list && was_mesh_reply) { log_assert(mesh->num_reply_states > 0); mesh->num_reply_states--; } @@ -1960,7 +1962,7 @@ mesh_serve_expired_callback(void* arg) r = mstate->reply_list; mstate->reply_list = NULL; - if(!mstate->reply_list && !mstate->cb_list) { + if(!mstate->reply_list && !mstate->cb_list && r) { log_assert(mesh->num_reply_states > 0); mesh->num_reply_states--; if(mstate->super_set.count == 0) {