From: Arran Cudbard-Bell Date: Wed, 2 Sep 2015 13:11:21 +0000 (-0400) Subject: Register the listen xlat in mainconfig not listen_init X-Git-Tag: release_3_0_10~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea007f41ed88a5814001af02429f9618087cb20a;p=thirdparty%2Ffreeradius-server.git Register the listen xlat in mainconfig not listen_init By the time listen_init is called, it's too late (guessing that's why client and getclient were moved there too). --- diff --git a/src/include/radiusd.h b/src/include/radiusd.h index 1123b777a23..7cae21d59fa 100644 --- a/src/include/radiusd.h +++ b/src/include/radiusd.h @@ -555,6 +555,7 @@ void main_config_hup(void); void hup_logfile(void); /* listen.c */ +ssize_t xlat_listen(UNUSED void *instance, REQUEST *request, char const *fmt, char **out, size_t outlen); void listen_free(rad_listen_t **head); int listen_init(CONF_SECTION *cs, rad_listen_t **head, bool spawn_flag); rad_listen_t *proxy_new_listener(TALLOC_CTX *ctx, home_server_t *home, uint16_t src_port); diff --git a/src/main/listen.c b/src/main/listen.c index 8b33e197445..3d173960bd0 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -80,9 +80,8 @@ static fr_protocol_t master_listen[]; /* * Xlat for %{listen:foo} */ -static ssize_t xlat_listen(UNUSED void *instance, REQUEST *request, - char const *fmt, char *out, - size_t outlen) +ssize_t xlat_listen(UNUSED void *instance, REQUEST *request, + char const *fmt, char *out, size_t outlen) { char const *value = NULL; CONF_PAIR *cp; @@ -3367,8 +3366,11 @@ add_sockets: */ if (!*head) return -1; +<<<<<<< HEAD xlat_register("listen", xlat_listen, NULL, NULL); +======= +>>>>>>> d376ada... Register the listen xlat in mainconfig not listen_init return 0; } diff --git a/src/main/mainconfig.c b/src/main/mainconfig.c index e14208d4ca1..0f21dbdf0e6 100644 --- a/src/main/mainconfig.c +++ b/src/main/mainconfig.c @@ -966,11 +966,12 @@ do {\ } /* - * Register the %{config:section.subsection} xlat function. + * Register the %{config:section.subsection} xlat function. */ xlat_register("config", xlat_config, NULL, NULL); xlat_register("client", xlat_client, NULL, NULL); xlat_register("getclient", xlat_getclient, NULL, NULL); + xlat_register("listen", xlat_listen, NULL, NULL); /* * Go update our behaviour, based on the configuration