]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Flags need to match what will be on the created DA
authorNick Porter <nick@portercomputing.co.uk>
Tue, 13 Feb 2024 17:19:25 +0000 (17:19 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 15 Feb 2024 16:32:34 +0000 (16:32 +0000)
After inserting, tmpl_attr_tail_unresolved_add checks the resulting
flags and fails if they differ.

src/modules/rlm_sqlcounter/rlm_sqlcounter.c

index c434d5d46110a811ea0b0f849571d34e3d489572..3186dfdf517d9763da58639343240e9a09fdb077 100644 (file)
@@ -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;