From: Alan T. DeKok Date: Fri, 2 Apr 2021 19:20:22 +0000 (-0400) Subject: use better names for CoA home server / pool X-Git-Tag: release_3_0_24~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ae3e72a82ae40e2681bf690f5ebaaa8bf337bcd;p=thirdparty%2Ffreeradius-server.git use better names for CoA home server / pool --- diff --git a/src/include/clients.h b/src/include/clients.h index 193cadafdd1..fc6034a2f5b 100644 --- a/src/include/clients.h +++ b/src/include/clients.h @@ -95,9 +95,9 @@ typedef struct radclient { #ifdef WITH_COA char const *coa_name; //!< Name of the CoA home server or pool. - home_server_t *coa_server; //!< The CoA home_server_t the client is associated with. + home_server_t *coa_home_server; //!< The CoA home_server_t the client is associated with. //!< Must be used exclusively from coa_pool. - home_pool_t *coa_pool; //!< The CoA home_pool_t the client is associated with. + home_pool_t *coa_home_pool; //!< The CoA home_pool_t the client is associated with. //!< Must be used exclusively from coa_server. bool defines_coa_server; //!< Client also defines a home_server. #endif diff --git a/src/main/client.c b/src/main/client.c index d717e38bfb3..455221865b3 100644 --- a/src/main/client.c +++ b/src/main/client.c @@ -213,7 +213,7 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client) /* * If the client also defines a server, do that now. */ - if (client->defines_coa_server) if (!realm_home_server_add(client->coa_server)) return false; + if (client->defines_coa_server) if (!realm_home_server_add(client->coa_home_server)) return false; /* * If there's no client list, BUT there's a virtual @@ -324,8 +324,8 @@ check_list: #endif #ifdef WITH_COA namecmp(coa_name) && - (old->coa_server == client->coa_server) && - (old->coa_pool == client->coa_pool) && + (old->coa_home_server == client->coa_home_server) && + (old->coa_home_pool == client->coa_home_pool) && #endif (old->message_authenticator == client->message_authenticator)) { WARN("Ignoring duplicate client %s", client->longname); @@ -880,7 +880,7 @@ int client_map_section(CONF_SECTION *out, CONF_SECTION const *map, client_value_ * @param ctx to allocate new clients in. * @param cs to process as a client. * @param in_server Whether the client should belong to a specific virtual server. - * @param with_coa If true and coa_server or coa_pool aren't specified automatically, + * @param with_coa If true and coa_server or coa_home_pool aren't specified automatically, * create a coa home_server section and add it to the client CONF_SECTION. * @return new RADCLIENT struct. */ @@ -1110,11 +1110,11 @@ RADCLIENT *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, bool in_server, bo cp = cf_pair_find(cs, "coa_server"); if (cp) { c->coa_name = cf_pair_value(cp); - c->coa_pool = home_pool_byname(c->coa_name, HOME_TYPE_COA); - if (!c->coa_pool) { - c->coa_server = home_server_byname(c->coa_name, HOME_TYPE_COA); + c->coa_home_pool = home_pool_byname(c->coa_name, HOME_TYPE_COA); + if (!c->coa_home_pool) { + c->coa_home_server = home_server_byname(c->coa_name, HOME_TYPE_COA); } - if (!c->coa_pool && !c->coa_server) { + if (!c->coa_home_pool && !c->coa_home_server) { cf_log_err_cs(cs, "No such home_server or home_server_pool \"%s\"", c->coa_name); goto error; } @@ -1152,7 +1152,7 @@ RADCLIENT *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, bool in_server, bo rad_assert(home->type == HOME_TYPE_COA); - c->coa_server = home; + c->coa_home_server = home; c->defines_coa_server = true; } } diff --git a/src/main/process.c b/src/main/process.c index 985b0e2c678..f10c6094c2e 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -4401,11 +4401,11 @@ static void request_coa_originate(REQUEST *request) /* * Prefer the pool to one server */ - } else if (request->client->coa_pool) { - coa->home_pool = request->client->coa_pool; + } else if (request->client->coa_home_pool) { + coa->home_pool = request->client->coa_home_pool; - } else if (request->client->coa_server) { - coa->home_server = request->client->coa_server; + } else if (request->client->coa_home_server) { + coa->home_server = request->client->coa_home_server; } else { /*