From 9ce4c88844218366c37ecc9fd13c8fbdaba93593 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 30 Apr 2015 19:48:24 -0400 Subject: [PATCH] Fix client_add for virtual servers. If there's a "listen" section, the clients are added to that virtual server. If there's no "listen" section in this virtual server, the clients are added to the global list. --- src/main/client.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/client.c b/src/main/client.c index a9044a33a5d0..110b45473e6f 100644 --- a/src/main/client.c +++ b/src/main/client.c @@ -231,6 +231,7 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client) if (!clients) { if (client->server != NULL) { CONF_SECTION *cs; + CONF_SECTION *listen; cs = cf_section_sub_find_name2(main_config.config, "server", client->server); if (!cs) { @@ -238,6 +239,13 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client) return false; } + /* + * If this server has no "listen" section, add the clients + * to the global client list. + */ + listen = cf_section_sub_find(cs, "listen"); + if (!listen) goto global_clients; + /* * If the client list already exists, use that. * Otherwise, create a new client list. @@ -258,6 +266,7 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client) } } else { + global_clients: /* * Initialize the global list, if not done already. */