From: Ralph Dolmans Date: Thu, 13 Aug 2020 12:57:21 +0000 (+0200) Subject: - Create and init edns tags data for libunbound. X-Git-Tag: release-1.12.0rc1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b05dcdf8c3fd4624e1847028fd03bf041b44508;p=thirdparty%2Funbound.git - Create and init edns tags data for libunbound. --- diff --git a/doc/Changelog b/doc/Changelog index 01f2ee3c2..8bc333e0d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/libunbound/context.c b/libunbound/context.c index 6d62e32b5..713259c71 100644 --- a/libunbound/context.c +++ b/libunbound/context.c @@ -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); diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index 3b30419b3..af26e5546 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -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;