]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
complete renaming of the modules edns list
authorTCY16 <tom@nlnetlabs.nl>
Mon, 8 Nov 2021 10:50:29 +0000 (11:50 +0100)
committerTCY16 <tom@nlnetlabs.nl>
Mon, 8 Nov 2021 10:50:29 +0000 (11:50 +0100)
daemon/worker.c
libunbound/libworker.c
services/authzone.c
services/localzone.c
services/mesh.c
services/outside_network.c
testcode/fake_event.c
util/data/msgencode.c
util/data/msgparse.c
util/data/msgreply.c
validator/autotrust.c

index b9103488f111587f82066ca8975b8c5078cd4d10..8880cac19977f4d93475eb75837b6f4d65fcb539 100644 (file)
@@ -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);
index b43bd960472f9e61dbae25971007066b2b8beb0d..7f753435d068292be7b5bb02c371ff15d8dff2a7 100644 (file)
@@ -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(
index d59573881b08147c0b3fab79ad38822d32dd48a5..3cf87ffd0f6828a9cc4d7565a78093a969fea365 100644 (file)
@@ -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;
index 03d16f965355f8f5bebb545e3e741b44b9630a78..a69aef8fd2d0f0a1f2682ec8d34d4213c2276671 100644 (file)
@@ -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);
 }
index e91c28485b22bd03f653722bff1f6a0af346f22c..d2a1c68567436c07eb3a7211cbbaf0e6b0f589f1 100644 (file)
@@ -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;
index d5443ad44c24d5f55c1292a7a2451d03a933009e..fdfba78973df3e8fb15af9f8e09d1bff30f4da15 100644 (file)
@@ -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)
index 6b0fed2f41cd4ba58f503cd6494d2f1141aad931..6a8245d4a6ab432b2f22ffde24531629acf2dcf4 100644 (file)
@@ -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);
index f0017089d1ca613db2cda512ee9613085b6f0f40..fe21cfb86bd11a46ef1b0a319f68d406bd340527 100644 (file)
@@ -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;
index 3e6a0affa1939bdf60f888a4e6b6350765da0859..7841b628bbb1f4b7eb2788297e1e952a7d7de735 100644 (file)
@@ -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 */
index 1d5a1f214f9d951cf000db1fd5675e7eb5afec8a..5fb28a9e45fb96fca30fb69381d645d0b2c45bfa 100644 (file)
@@ -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;
 }
 
index f26bfdb44ee3ce73c19e3f75fab79266104eebbc..55e82c176daefb9bc1502459d732f2f81e134a03 100644 (file)
@@ -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);