From 17559c737b93ce41eaee8b5d6ae1d0f965cff7f8 Mon Sep 17 00:00:00 2001 From: Boris VANHOOF Date: Tue, 23 May 2023 09:21:58 +0200 Subject: [PATCH 1/4] typo in comments --- iterator/iterator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iterator/iterator.c b/iterator/iterator.c index e7365c566..d04a1c3b5 100644 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@ -1121,7 +1121,7 @@ generate_a_aaaa_check(struct module_qstate* qstate, struct iter_qstate* iq, * Generate a NS check request to obtain authoritative information * on an NS rrset. * - * @param qstate: the qtstate that triggered the need to prime. + * @param qstate: the qstate that triggered the need to prime. * @param iq: iterator query state. * @param id: module id. */ From 62d54d8091263b4dc24c9c3715bc7a0a52e24e92 Mon Sep 17 00:00:00 2001 From: Boris VANHOOF Date: Tue, 23 May 2023 09:22:35 +0200 Subject: [PATCH 2/4] remove unused function --- services/mesh.c | 6 ------ services/mesh.h | 8 -------- 2 files changed, 14 deletions(-) diff --git a/services/mesh.c b/services/mesh.c index bff0c03e6..d7323bf58 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -891,12 +891,6 @@ mesh_state_create(struct module_env* env, struct query_info* qinfo, return mstate; } -int -mesh_state_is_unique(struct mesh_state* mstate) -{ - return mstate->unique != NULL; -} - void mesh_state_make_unique(struct mesh_state* mstate) { diff --git a/services/mesh.h b/services/mesh.h index 25121a67b..e4072a69c 100644 --- a/services/mesh.h +++ b/services/mesh.h @@ -478,14 +478,6 @@ struct mesh_state* mesh_state_create(struct module_env* env, struct query_info* qinfo, struct respip_client_info* cinfo, uint16_t qflags, int prime, int valrec); -/** - * Check if the mesh state is unique. - * A unique mesh state uses it's unique member to point to itself, else NULL. - * @param mstate: mesh state to check. - * @return true if the mesh state is unique, false otherwise. - */ -int mesh_state_is_unique(struct mesh_state* mstate); - /** * Make a mesh state unique. * A unique mesh state uses it's unique member to point to itself. From a21bc231393ea8266ba0ea069ec460f033905ad4 Mon Sep 17 00:00:00 2001 From: Boris VANHOOF Date: Tue, 23 May 2023 09:23:03 +0200 Subject: [PATCH 3/4] free memory in error case --- services/mesh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/mesh.c b/services/mesh.c index d7323bf58..f9a44fd5e 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -456,13 +456,14 @@ void mesh_new_client(struct mesh_area* mesh, struct query_info* qinfo, s->s.edns_opts_front_in = edns_opt_copy_region(edns->opt_list_in, s->s.region); if(!s->s.edns_opts_front_in) { - log_err("mesh_state_create: out of memory; SERVFAIL"); + log_err("edns_opt_copy_region: out of memory; SERVFAIL"); if(!inplace_cb_reply_servfail_call(mesh->env, qinfo, NULL, NULL, LDNS_RCODE_SERVFAIL, edns, rep, mesh->env->scratch, mesh->env->now_tv)) edns->opt_list_inplace_cb_out = NULL; error_encode(r_buffer, LDNS_RCODE_SERVFAIL, qinfo, qid, qflags, edns); comm_point_send_reply(rep); + mesh_state_delete(&s->s); return; } } @@ -575,6 +576,7 @@ mesh_new_callback(struct mesh_area* mesh, struct query_info* qinfo, s->s.edns_opts_front_in = edns_opt_copy_region(edns->opt_list_in, s->s.region); if(!s->s.edns_opts_front_in) { + mesh_state_delete(&s->s); return 0; } } From 4e39d3dfe15e2f8348f36592989d65e4da040dfa Mon Sep 17 00:00:00 2001 From: Boris VANHOOF Date: Tue, 23 May 2023 10:11:07 +0200 Subject: [PATCH 4/4] could not find package netcat for docker container --- contrib/Dockerfile.tests | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contrib/Dockerfile.tests b/contrib/Dockerfile.tests index 417daccb2..6cc3e4c1e 100644 --- a/contrib/Dockerfile.tests +++ b/contrib/Dockerfile.tests @@ -1,10 +1,8 @@ FROM gcc:latest WORKDIR /usr/src/unbound -RUN apt-get update # install semantic parser & lexical analyzer -RUN apt-get install -y bison flex # install packages used in tests -RUN apt-get install -y ldnsutils dnsutils xxd splint doxygen netcat +RUN apt-get update && apt-get install -y bison flex ldnsutils dnsutils xxd splint doxygen netcat-traditional # accept short rsa keys, which are used in tests RUN sed -i 's/SECLEVEL=2/SECLEVEL=1/g' /usr/lib/ssl/openssl.cnf