]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
set the new value.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 1 Oct 2021 15:42:17 +0000 (11:42 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 5 Oct 2021 18:39:16 +0000 (14:39 -0400)
this will be used after the server starts, because that's when
the callback is hit.  It won't (yet) be used in references
as the configuration files are being read.

src/lib/server/main_config.c

index 64736601ff02c69d9983d14952066ff400566fc8..6fa282a5656ca616b02ab6d371fa8e732c19e2b8 100644 (file)
@@ -401,6 +401,8 @@ static int num_workers_parse(TALLOC_CTX *ctx, void *out, void *parent,
         *      discover it automatically.
         */
        if (value == 0) {
+               char *strvalue;
+
                value = fr_hw_num_cores_active();
 
                /*
@@ -418,6 +420,10 @@ static int num_workers_parse(TALLOC_CTX *ctx, void *out, void *parent,
                        value -= conf->max_networks;
                }
 
+               strvalue = talloc_asprintf(ci, "%u", value);
+               (void) cf_pair_replace(cf_item_to_section(cf_parent(ci)), cf_item_to_pair(ci), strvalue);
+               talloc_free(strvalue);
+
                /*
                 *      Otherwise just create as many
                 *      workers as we have cores.