From: Alan T. DeKok Date: Wed, 15 Jun 2011 08:34:21 +0000 (+0200) Subject: Look inside of virtuals for homes X-Git-Tag: release_3_0_0_beta0~767 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=592fb1973ed4f08cbc25a3ca3c02acbe08149281;p=thirdparty%2Ffreeradius-server.git Look inside of virtuals for homes This allows home servers to be tied to virtuals --- diff --git a/src/main/realms.c b/src/main/realms.c index c82131dbd8e..86ba068c94f 100644 --- a/src/main/realms.c +++ b/src/main/realms.c @@ -1809,6 +1809,9 @@ static int pool_peek_type(CONF_SECTION *config, CONF_SECTION *cs) int realms_init(CONF_SECTION *config) { CONF_SECTION *cs; +#ifdef WITH_PROXY + CONF_SECTION *server_cs; +#endif realm_config_t *rc, *old_rc; if (realms_byname) return 1; @@ -1872,6 +1875,24 @@ int realms_init(CONF_SECTION *config) return 0; } } + + /* + * Loop over virtual servers to find homes which are + * defined in them. + */ + for (server_cs = cf_subsection_find_next(config, NULL, "server"); + server_cs != NULL; + server_cs = cf_subsection_find_next(config, server_cs, "server")) { + for (cs = cf_subsection_find_next(server_cs, NULL, "home_server"); + cs != NULL; + cs = cf_subsection_find_next(server_cs, cs, "home_server")) { + if (!home_server_add(rc, cs)) { + free(rc); + realms_free(); + return 0; + } + } + } #endif for (cs = cf_subsection_find_next(config, NULL, "realm");