From: Alan T. DeKok Date: Fri, 1 Oct 2021 15:42:17 +0000 (-0400) Subject: set the new value. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bdf97cc9c35c21d5e4f3dfb462a16ec313f4e75;p=thirdparty%2Ffreeradius-server.git set the new value. 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. --- diff --git a/src/lib/server/main_config.c b/src/lib/server/main_config.c index 64736601ff0..6fa282a5656 100644 --- a/src/lib/server/main_config.c +++ b/src/lib/server/main_config.c @@ -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.