From: Nick Porter Date: Tue, 13 Feb 2024 17:19:25 +0000 (+0000) Subject: Flags need to match what will be on the created DA X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95aee787207098ad49f84aeeea9120fc7f8ab86b;p=thirdparty%2Ffreeradius-server.git Flags need to match what will be on the created DA After inserting, tmpl_attr_tail_unresolved_add checks the resulting flags and fails if they differ. --- diff --git a/src/modules/rlm_sqlcounter/rlm_sqlcounter.c b/src/modules/rlm_sqlcounter/rlm_sqlcounter.c index c434d5d4611..3186dfdf517 100644 --- a/src/modules/rlm_sqlcounter/rlm_sqlcounter.c +++ b/src/modules/rlm_sqlcounter/rlm_sqlcounter.c @@ -451,7 +451,7 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx) { rlm_sqlcounter_t *inst = talloc_get_type_abort(mctx->inst->data, rlm_sqlcounter_t); CONF_SECTION *conf = mctx->inst->conf; - fr_dict_attr_flags_t flags; + fr_dict_attr_flags_t flags = (fr_dict_attr_flags_t) { .internal = 1, .length = 8 }; /* * Create a new attribute for the counter. @@ -459,7 +459,6 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx) fr_assert(inst->counter_attr); fr_assert(inst->limit_attr); - memset(&flags, 0, sizeof(flags)); if (tmpl_attr_tail_unresolved_add(fr_dict_unconst(dict_freeradius), inst->start_attr, FR_TYPE_UINT64, &flags) < 0) { cf_log_perr(conf, "Failed defining reset_period_start attribute"); return -1;