From dff97daa5b8ba41cbd2f8b82ff30cc9f72ef5bff Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Fri, 15 Nov 2024 15:32:00 +0000 Subject: [PATCH] Ensure CONF_SECTION used to create dynamic clients is visible So that %client() works the same for dynamic clients as static ones --- src/lib/io/master.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/io/master.c b/src/lib/io/master.c index 9735498f14c4..d97ea707074d 100644 --- a/src/lib/io/master.c +++ b/src/lib/io/master.c @@ -2465,6 +2465,7 @@ static ssize_t mod_write(fr_listen_t *li, void *packet_ctx, fr_time_t request_ti COPY_FIELD(require_message_authenticator); COPY_FIELD(limit_proxy_state); COPY_FIELD(use_connected); + COPY_FIELD(cs); // @todo - fill in other fields? @@ -2473,7 +2474,12 @@ static ssize_t mod_write(fr_listen_t *li, void *packet_ctx, fr_time_t request_ti radclient = client->radclient; /* laziness */ radclient->server_cs = inst->server_cs; radclient->server = cf_section_name2(inst->server_cs); - radclient->cs = NULL; + + /* + * Re-parent the conf section used to build this client + * so its lifetime is linked to the client + */ + talloc_steal(radclient, radclient->cs); /* * This is a connected socket, and it's just been