From: Arran Cudbard-Bell Date: Thu, 15 Jun 2023 15:20:09 +0000 (-0400) Subject: xlat: Register xlat protocols _AFTER_ bootstrap has completed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c315a7ad4e3062ba140a771d727a03e46b35462;p=thirdparty%2Ffreeradius-server.git xlat: Register xlat protocols _AFTER_ bootstrap has completed --- diff --git a/src/lib/server/base.c b/src/lib/server/base.c index 9b43af06456..876bf602758 100644 --- a/src/lib/server/base.c +++ b/src/lib/server/base.c @@ -27,6 +27,7 @@ RCSID("$Id$") #include #include +#include /** Initialize src/lib/server/ * @@ -74,6 +75,17 @@ int server_init(CONF_SECTION *cs) */ if (modules_rlm_bootstrap(cs) < 0) return -1; + /* + * Now all the modules and virtual servers have been bootstrapped, + * we have all the dictionaries we're going to use in the server. + * + * We can now register xlats for any protocol encoders/decoders. + * + * Note: These xlats get freed automatically, so no explicit cleanup + * is required. + */ + if (xlat_protocols_register() < 0) return -1; + /* * And then load the virtual servers. */ diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index d9076f51d4c..306a20f5293 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -3269,11 +3269,6 @@ int xlat_init(void) */ unlang_xlat_init(); - /* - * Define encode/decode xlats for the various protocols. - */ - if (xlat_protocol_init() < 0) return -1; - /* * These are all "pure" functions. */