From: TCY16 Date: Mon, 8 Nov 2021 10:50:29 +0000 (+0100) Subject: complete renaming of the modules edns list X-Git-Tag: release-1.14.0rc1~27^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8205c87a96a8ec62098d4bc7578cbeaeeab686de;p=thirdparty%2Funbound.git complete renaming of the modules edns list --- diff --git a/daemon/worker.c b/daemon/worker.c index b9103488f..8880cac19 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -522,7 +522,7 @@ answer_norec_from_cache(struct worker* worker, struct query_info* qinfo, if(!inplace_cb_reply_servfail_call(&worker->env, qinfo, NULL, NULL, LDNS_RCODE_SERVFAIL, edns, repinfo, worker->scratchpad, worker->env.now_tv)) - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; error_encode(repinfo->c->buffer, LDNS_RCODE_SERVFAIL, &msg->qinfo, id, flags, edns); } @@ -722,7 +722,7 @@ answer_from_cache(struct worker* worker, struct query_info* qinfo, if(!inplace_cb_reply_servfail_call(&worker->env, qinfo, NULL, NULL, LDNS_RCODE_SERVFAIL, edns, repinfo, worker->scratchpad, worker->env.now_tv)) - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; error_encode(repinfo->c->buffer, LDNS_RCODE_SERVFAIL, qinfo, id, flags, edns); } @@ -788,7 +788,7 @@ chaos_replystr(sldns_buffer* pkt, char** str, int num, struct edns_data* edns, if(!inplace_cb_reply_local_call(&worker->env, NULL, NULL, NULL, LDNS_RCODE_NOERROR, edns, repinfo, worker->scratchpad, worker->env.now_tv)) - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; sldns_buffer_clear(pkt); sldns_buffer_skip(pkt, (ssize_t)sizeof(uint16_t)); /* skip id */ sldns_buffer_write_u16(pkt, (uint16_t)(BIT_QR|BIT_RA)); @@ -1262,7 +1262,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error, edns.bits &= EDNS_DO; edns.opt_list_in = NULL; edns.opt_list_out = NULL; - edns.opt_list_modules_out = NULL; + edns.opt_list_inplace_cb_out = NULL; edns.padding_block_size = 0; verbose(VERB_ALGO, "query with bad edns version."); log_addr(VERB_CLIENT,"from",&repinfo->addr, repinfo->addrlen); diff --git a/libunbound/libworker.c b/libunbound/libworker.c index b43bd9604..7f753435d 100644 --- a/libunbound/libworker.c +++ b/libunbound/libworker.c @@ -602,7 +602,7 @@ setup_qinfo_edns(struct libworker* w, struct ctx_query* q, edns->bits = EDNS_DO; edns->opt_list_in = NULL; edns->opt_list_out = NULL; - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; edns->padding_block_size = 0; if(sldns_buffer_capacity(w->back->udp_buff) < 65535) edns->udp_size = (uint16_t)sldns_buffer_capacity( diff --git a/services/authzone.c b/services/authzone.c index d59573881..3cf87ffd0 100644 --- a/services/authzone.c +++ b/services/authzone.c @@ -3518,7 +3518,7 @@ auth_error_encode(struct query_info* qinfo, struct module_env* env, if(!inplace_cb_reply_local_call(env, qinfo, NULL, NULL, rcode, edns, repinfo, temp, env->now_tv)) - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; error_encode(buf, rcode|BIT_AA, qinfo, *(uint16_t*)sldns_buffer_begin(buf), sldns_buffer_read_u16_at(buf, 2), edns); @@ -5360,7 +5360,7 @@ xfr_transfer_lookup_host(struct auth_xfer* xfr, struct module_env* env) edns.bits = EDNS_DO; edns.opt_list_in = NULL; edns.opt_list_out = NULL; - edns.opt_list_modules_out = NULL; + edns.opt_list_inplace_cb_out = NULL; edns.padding_block_size = 0; if(sldns_buffer_capacity(buf) < 65535) edns.udp_size = (uint16_t)sldns_buffer_capacity(buf); @@ -6551,7 +6551,7 @@ xfr_probe_lookup_host(struct auth_xfer* xfr, struct module_env* env) edns.bits = EDNS_DO; edns.opt_list_in = NULL; edns.opt_list_out = NULL; - edns.opt_list_modules_out = NULL; + edns.opt_list_inplace_cb_out = NULL; edns.padding_block_size = 0; if(sldns_buffer_capacity(buf) < 65535) edns.udp_size = (uint16_t)sldns_buffer_capacity(buf); @@ -8328,7 +8328,7 @@ zonemd_lookup_dnskey(struct auth_zone* z, struct module_env* env) edns.bits = EDNS_DO; edns.opt_list_in = NULL; edns.opt_list_out = NULL; - edns.opt_list_modules_out = NULL; + edns.opt_list_inplace_cb_out = NULL; if(sldns_buffer_capacity(buf) < 65535) edns.udp_size = (uint16_t)sldns_buffer_capacity(buf); else edns.udp_size = 65535; diff --git a/services/localzone.c b/services/localzone.c index 03d16f965..a69aef8fd 100644 --- a/services/localzone.c +++ b/services/localzone.c @@ -1299,7 +1299,7 @@ local_error_encode(struct query_info* qinfo, struct module_env* env, if(!inplace_cb_reply_local_call(env, qinfo, NULL, NULL, rcode, edns, repinfo, temp, env->now_tv)) - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; error_encode(buf, r, qinfo, *(uint16_t*)sldns_buffer_begin(buf), sldns_buffer_read_u16_at(buf, 2), edns); } diff --git a/services/mesh.c b/services/mesh.c index e91c28485..d2a1c6856 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -505,7 +505,7 @@ void mesh_new_client(struct mesh_area* mesh, struct query_info* qinfo, log_err("mesh_state_create: 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_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; error_encode(r_buffer, LDNS_RCODE_SERVFAIL, qinfo, qid, qflags, edns); comm_point_send_reply(rep); @@ -521,7 +521,7 @@ void mesh_new_client(struct mesh_area* mesh, struct query_info* qinfo, log_err("mesh_state_create: 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_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; error_encode(r_buffer, LDNS_RCODE_SERVFAIL, qinfo, qid, qflags, edns); comm_point_send_reply(rep); @@ -594,7 +594,7 @@ void mesh_new_client(struct mesh_area* mesh, struct query_info* qinfo, servfail_mem: if(!inplace_cb_reply_servfail_call(mesh->env, qinfo, &s->s, NULL, LDNS_RCODE_SERVFAIL, edns, rep, mesh->env->scratch, mesh->env->now_tv)) - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; error_encode(r_buffer, LDNS_RCODE_SERVFAIL, qinfo, qid, qflags, edns); comm_point_send_reply(rep); @@ -1145,11 +1145,11 @@ mesh_do_callback(struct mesh_state* m, int rcode, struct reply_info* rep, if(rcode == LDNS_RCODE_SERVFAIL) { if(!inplace_cb_reply_servfail_call(m->s.env, &m->s.qinfo, &m->s, rep, rcode, &r->edns, NULL, m->s.region, start_time)) - r->edns.opt_list_modules_out = NULL; + r->edns.opt_list_inplace_cb_out = NULL; } else { if(!inplace_cb_reply_call(m->s.env, &m->s.qinfo, &m->s, rep, rcode, &r->edns, NULL, m->s.region, start_time)) - r->edns.opt_list_modules_out = NULL; + r->edns.opt_list_inplace_cb_out = NULL; } fptr_ok(fptr_whitelist_mesh_cb(r->cb)); (*r->cb)(r->cb_arg, rcode, r->buf, sec_status_unchecked, NULL, @@ -1267,7 +1267,7 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep, prev->edns.bits == r->edns.bits && prev->edns.udp_size == r->edns.udp_size && edns_opt_list_compare(prev->edns.opt_list_out, r->edns.opt_list_out) == 0 && - edns_opt_list_compare(prev->edns.opt_list_modules_out, r->edns.opt_list_modules_out) == 0 + edns_opt_list_compare(prev->edns.opt_list_inplace_cb_out, r->edns.opt_list_inplace_cb_out) == 0 ) { /* if the previous reply is identical to this one, fix ID */ if(prev_buffer != r_buffer) @@ -1284,11 +1284,11 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep, if(rcode == LDNS_RCODE_SERVFAIL) { if(!inplace_cb_reply_servfail_call(m->s.env, &m->s.qinfo, &m->s, rep, rcode, &r->edns, &r->query_reply, m->s.region, &r->start_time)) - r->edns.opt_list_modules_out = NULL; + r->edns.opt_list_inplace_cb_out = NULL; } else { if(!inplace_cb_reply_call(m->s.env, &m->s.qinfo, &m->s, rep, rcode, &r->edns, &r->query_reply, m->s.region, &r->start_time)) - r->edns.opt_list_modules_out = NULL; + r->edns.opt_list_inplace_cb_out = NULL; } error_encode(r_buffer, rcode, &m->s.qinfo, r->qid, r->qflags, &r->edns); @@ -1312,7 +1312,7 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep, { if(!inplace_cb_reply_servfail_call(m->s.env, &m->s.qinfo, &m->s, rep, LDNS_RCODE_SERVFAIL, &r->edns, &r->query_reply, m->s.region, &r->start_time)) - r->edns.opt_list_modules_out = NULL; + r->edns.opt_list_inplace_cb_out = NULL; error_encode(r_buffer, LDNS_RCODE_SERVFAIL, &m->s.qinfo, r->qid, r->qflags, &r->edns); } @@ -1509,8 +1509,8 @@ int mesh_state_add_cb(struct mesh_state* s, struct edns_data* edns, if(edns->opt_list_out && !(r->edns.opt_list_out = edns_opt_copy_region(edns->opt_list_out, s->s.region))) return 0; - if(edns->opt_list_modules_out && !(r->edns.opt_list_modules_out = - edns_opt_copy_region(edns->opt_list_modules_out, s->s.region))) + if(edns->opt_list_inplace_cb_out && !(r->edns.opt_list_inplace_cb_out = + edns_opt_copy_region(edns->opt_list_inplace_cb_out, s->s.region))) return 0; r->qid = qid; r->qflags = qflags; @@ -1536,8 +1536,8 @@ int mesh_state_add_reply(struct mesh_state* s, struct edns_data* edns, if(edns->opt_list_out && !(r->edns.opt_list_out = edns_opt_copy_region(edns->opt_list_out, s->s.region))) return 0; - if(edns->opt_list_modules_out && !(r->edns.opt_list_modules_out = - edns_opt_copy_region(edns->opt_list_modules_out, s->s.region))) + if(edns->opt_list_inplace_cb_out && !(r->edns.opt_list_inplace_cb_out = + edns_opt_copy_region(edns->opt_list_inplace_cb_out, s->s.region))) return 0; r->qid = qid; r->qflags = qflags; diff --git a/services/outside_network.c b/services/outside_network.c index d5443ad44..fdfba7897 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -2711,7 +2711,7 @@ serviced_encode(struct serviced_query* sq, sldns_buffer* buff, int with_edns) edns.edns_version = EDNS_ADVERTISED_VERSION; edns.opt_list_in = NULL; edns.opt_list_out = sq->opt_list; - edns.opt_list_modules_out = NULL; + edns.opt_list_inplace_cb_out = NULL; if(sq->status == serviced_query_UDP_EDNS_FRAG) { if(addr_is_ip6(&sq->addr, sq->addrlen)) { if(EDNS_FRAG_SIZE_IP6 < EDNS_ADVERTISED_SIZE) diff --git a/testcode/fake_event.c b/testcode/fake_event.c index 6b0fed2f4..6a8245d4a 100644 --- a/testcode/fake_event.c +++ b/testcode/fake_event.c @@ -1246,7 +1246,7 @@ struct serviced_query* outnet_serviced_query(struct outside_network* outnet, } edns.opt_list_in = NULL; edns.opt_list_out = qstate->edns_opts_back_out; - edns.opt_list_modules_out = NULL; + edns.opt_list_inplace_cb_out = NULL; attach_edns_record(pend->buffer, &edns); } memcpy(&pend->addr, addr, addrlen); diff --git a/util/data/msgencode.c b/util/data/msgencode.c index f0017089d..fe21cfb86 100644 --- a/util/data/msgencode.c +++ b/util/data/msgencode.c @@ -796,7 +796,7 @@ calc_edns_field_size(struct edns_data* edns) struct edns_option* opt; if(!edns || !edns->edns_present) return 0; - for(opt = edns->opt_list_modules_out; opt; opt = opt->next) { + for(opt = edns->opt_list_inplace_cb_out; opt; opt = opt->next) { rdatalen += 4 + opt->opt_len; } for(opt = edns->opt_list_out; opt; opt = opt->next) { @@ -830,7 +830,7 @@ attach_edns_record_max_msg_sz(sldns_buffer* pkt, struct edns_data* edns, rdatapos = sldns_buffer_position(pkt); sldns_buffer_write_u16(pkt, 0); /* rdatalen */ /* write rdata */ - for(opt=edns->opt_list_modules_out; opt; opt=opt->next) { + for(opt=edns->opt_list_inplace_cb_out; opt; opt=opt->next) { if (opt->opt_code == LDNS_EDNS_PADDING) { padding_option = opt; continue; diff --git a/util/data/msgparse.c b/util/data/msgparse.c index 3e6a0affa..7841b628b 100644 --- a/util/data/msgparse.c +++ b/util/data/msgparse.c @@ -1101,7 +1101,7 @@ parse_extract_edns(struct msg_parse* msg, struct edns_data* edns, edns->udp_size = ntohs(found->rrset_class); edns->opt_list_in = NULL; edns->opt_list_out = NULL; - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; edns->padding_block_size = 0; /* take the options */ @@ -1145,7 +1145,6 @@ int parse_edns_from_pkt(sldns_buffer* pkt, struct edns_data* edns, struct config_file* cfg, struct comm_point* c, struct regional* region) { - int rcode; size_t rdata_len; uint8_t* rdata_ptr; log_assert(LDNS_QDCOUNT(sldns_buffer_begin(pkt)) == 1); @@ -1178,7 +1177,7 @@ parse_edns_from_pkt(sldns_buffer* pkt, struct edns_data* edns, edns->bits = sldns_buffer_read_u16(pkt); edns->opt_list_in = NULL; edns->opt_list_out = NULL; - edns->opt_list_modules_out = NULL; + edns->opt_list_inplace_cb_out = NULL; edns->padding_block_size = 0; /* take the options */ diff --git a/util/data/msgreply.c b/util/data/msgreply.c index 1d5a1f214..5fb28a9e4 100644 --- a/util/data/msgreply.c +++ b/util/data/msgreply.c @@ -1069,7 +1069,7 @@ static int inplace_cb_reply_call_generic( (void)(*(inplace_cb_reply_func_type*)cb->cb)(qinfo, qstate, rep, rcode, edns, &opt_list_out, repinfo, region, start_time, cb->id, cb->cb_arg); } - edns->opt_list_modules_out = opt_list_out; + edns->opt_list_inplace_cb_out = opt_list_out; return 1; } diff --git a/validator/autotrust.c b/validator/autotrust.c index f26bfdb44..55e82c176 100644 --- a/validator/autotrust.c +++ b/validator/autotrust.c @@ -2379,7 +2379,7 @@ probe_anchor(struct module_env* env, struct trust_anchor* tp) edns.bits = EDNS_DO; edns.opt_list_in = NULL; edns.opt_list_out = NULL; - edns.opt_list_modules_out = NULL; + edns.opt_list_inplace_cb_out = NULL; edns.padding_block_size = 0; if(sldns_buffer_capacity(buf) < 65535) edns.udp_size = (uint16_t)sldns_buffer_capacity(buf);