From: Arran Cudbard-Bell Date: Sat, 20 Mar 2021 17:44:35 +0000 (+0000) Subject: process_radius - Use server_cs pointer from bootstrap instead of the request X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abc513da4b489796668a8f994a7f92b448577e7e;p=thirdparty%2Ffreeradius-server.git process_radius - Use server_cs pointer from bootstrap instead of the request --- diff --git a/src/process/radius/base.c b/src/process/radius/base.c index 04b8dd536df..8b53fd70211 100644 --- a/src/process/radius/base.c +++ b/src/process/radius/base.c @@ -129,6 +129,7 @@ typedef struct { } process_radius_auth_t; typedef struct { + CONF_SECTION *server_cs; //!< Our virtual server. process_radius_sections_t sections; //!< Pointers to various config sections ///< we need to execute. process_radius_auth_t auth; //!< Authentication configuration. @@ -345,7 +346,7 @@ RESUME(access_request) dv = fr_dict_enum_by_value(vp->da, &vp->data); if (!dv) goto send_reply; - cs = cf_section_find(request->server_cs, "authenticate", dv->name); + cs = cf_section_find(inst->server_cs, "authenticate", dv->name); if (!cs) { RDEBUG2("No 'authenticate %s { ... }' section found - skipping...", dv->name); goto send_reply; @@ -611,7 +612,7 @@ RESUME(accounting_request) dv = fr_dict_enum_by_value(vp->da, &vp->data); if (!dv) goto send_reply; - cs = cf_section_find(request->server_cs, "accounting", dv->name); + cs = cf_section_find(inst->server_cs, "accounting", dv->name); if (!cs) { RDEBUG2("No 'accounting %s { ... }' section found - skipping...", dv->name); goto send_reply; @@ -673,8 +674,9 @@ static int mod_instantiate(void *instance, UNUSED CONF_SECTION *process_app_cs) return 0; } -static int mod_bootstrap(UNUSED void *instance, CONF_SECTION *cs) +static int mod_bootstrap(void *instance, CONF_SECTION *cs) { + process_radius_t *inst = instance; CONF_SECTION *server_cs; server_cs = cf_item_to_section(cf_parent(cs)); @@ -682,6 +684,8 @@ static int mod_bootstrap(UNUSED void *instance, CONF_SECTION *cs) if (virtual_server_section_attribute_define(server_cs, "authenticate", attr_auth_type) < 0) return -1; + inst->server_cs = server_cs; + return 0; }