]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
use correct edns_list attach function
authorTCY16 <tom@nlnetlabs.nl>
Wed, 21 Sep 2022 14:19:38 +0000 (16:19 +0200)
committerTCY16 <tom@nlnetlabs.nl>
Wed, 21 Sep 2022 14:19:38 +0000 (16:19 +0200)
daemon/worker.c

index 3f94b22d30638c4616990f2ae9591040563b1b6e..a13bb9530fb5c3a4306484007a5f8719bd97117e 100644 (file)
@@ -486,16 +486,11 @@ answer_norec_from_cache(struct worker* worker, struct query_info* qinfo,
                                        return 0;
                        /* Attached the cached EDE (RFC8914) */
                        if (worker->env.cfg->ede) {
-                               size_t reason_bogus_str_len = 0;
                                char* reason_bogus_str = msg->rep->reason_bogus_str;
 
-                               if (reason_bogus_str) {
-                                       reason_bogus_str_len = strlen(reason_bogus_str);
-                               }
-
-                               edns_opt_list_append(&edns->opt_list_out,
-                                       msg->rep->reason_bogus, reason_bogus_str_len,
-                                       reason_bogus_str, worker->scratchpad);
+                               edns_opt_list_append_ede(&edns->opt_list_out,
+                                       worker->scratchpad, msg->rep->reason_bogus,
+                                       reason_bogus_str);
                        }
                        error_encode(repinfo->c->buffer, LDNS_RCODE_SERVFAIL, 
                                &msg->qinfo, id, flags, edns);
@@ -669,16 +664,11 @@ answer_from_cache(struct worker* worker, struct query_info* qinfo,
                        goto bail_out;
                /* Attached the cached EDE (RFC8914) */
                if (worker->env.cfg->ede) {
-                       size_t reason_bogus_str_len = 0;
                        char* reason_bogus_str = rep->reason_bogus_str;
 
-                       if (reason_bogus_str) {
-                               reason_bogus_str_len = strlen(reason_bogus_str);
-                       }
-
-                       edns_opt_list_append(&edns->opt_list_out,
-                               rep->reason_bogus, reason_bogus_str_len,
-                               reason_bogus_str, worker->scratchpad);
+                       edns_opt_list_append_ede(&edns->opt_list_out,
+                                       worker->scratchpad, rep->reason_bogus,
+                                       reason_bogus_str);
                }
                error_encode(repinfo->c->buffer, LDNS_RCODE_SERVFAIL,
                        qinfo, id, flags, edns);