]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Create and init edns tags data for libunbound.
authorRalph Dolmans <ralph@nlnetlabs.nl>
Thu, 13 Aug 2020 12:57:21 +0000 (14:57 +0200)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Thu, 13 Aug 2020 12:57:21 +0000 (14:57 +0200)
doc/Changelog
libunbound/context.c
libunbound/libunbound.c

index 01f2ee3c20b2719f834ee18f81acdb1ca764068a..8bc333e0d77878d9b5107e1b2deec1e1adf4c427 100644 (file)
@@ -1,3 +1,6 @@
+13 August 2020: Ralph
+       - Create and init edns tags data for libunbound.
+
 10 August 2020: Ralph
        - Merge (modified) PR #277, use EVP_MAC_CTX_set_params if available,
          by Vítězslav Čížek.
index 6d62e32b50fdd5d9e977bdb569bbfdf77fbc684a..713259c718ce0ce52ea7825d0fe2fe8d00e9c258 100644 (file)
@@ -50,6 +50,7 @@
 #include "services/authzone.h"
 #include "util/data/msgreply.h"
 #include "util/storage/slabhash.h"
+#include "util/edns.h"
 #include "sldns/sbuffer.h"
 
 int 
@@ -79,6 +80,8 @@ context_finalize(struct ub_ctx* ctx)
                return UB_INITFAIL;
        if(!auth_zones_apply_cfg(ctx->env->auth_zones, cfg, 1, &is_rpz))
                return UB_INITFAIL;
+       if(!edns_tags_apply_cfg(ctx->env->edns_tags, cfg))
+               return UB_INITFAIL;
        if(!slabhash_is_size(ctx->env->msg_cache, cfg->msg_cache_size,
                cfg->msg_cache_slabs)) {
                slabhash_delete(ctx->env->msg_cache);
index 3b30419b315e35b444086b32520d17d84952435a..af26e5546fe933af772b078f2af7079557a9543b 100644 (file)
@@ -58,6 +58,7 @@
 #include "util/net_help.h"
 #include "util/tube.h"
 #include "util/ub_event.h"
+#include "util/edns.h"
 #include "services/modstack.h"
 #include "services/localzone.h"
 #include "services/cache/infra.h"
@@ -153,6 +154,18 @@ static struct ub_ctx* ub_ctx_create_nopipe(void)
                errno = ENOMEM;
                return NULL;
        }
+       ctx->env->edns_tags = edns_tags_create();
+       if(!ctx->env->edns_tags) {
+               auth_zones_delete(ctx->env->auth_zones);
+               edns_known_options_delete(ctx->env);
+               config_delete(ctx->env->cfg);
+               free(ctx->env);
+               ub_randfree(ctx->seed_rnd);
+               free(ctx);
+               errno = ENOMEM;
+               return NULL;
+       }
+
        ctx->env->alloc = &ctx->superalloc;
        ctx->env->worker = NULL;
        ctx->env->need_to_validate = 0;