+
+ if (load_component_section(subcs, components, comp) < 0) {
+ goto error;
+ }
+
+ /*
+ * Cache a default, if it exists. Some people
+ * put empty sections for some reason...
+ */
+ c = lookup_by_index(components, comp, 0);
+ if (c) server->mc[comp] = c->modulelist;
+
+ server->subcs[comp] = subcs;
+
+ flag = 1;
+ } /* loop over components */
+
+ /*
+ * We haven't loaded any of the normal sections. Maybe we're
+ * supposed to load the vmps section.
+ *
+ * This is a bit of a hack...
+ */
+ if (!flag) {
+ CONF_SECTION *subcs;
+
+ subcs = cf_section_sub_find(cs, "vmps");
+ if (subcs) {
+ cf_log_module(cs, "Checking vmps {...} for more modules to load");
+ if (load_component_section(subcs, components,
+ RLM_COMPONENT_POST_AUTH) < 0) {
+ goto error;
+ }
+ c = lookup_by_index(components,
+ RLM_COMPONENT_POST_AUTH, 0);
+ if (c) server->mc[RLM_COMPONENT_POST_AUTH] = c->modulelist;
+ flag = 1;
+ }
+
+#ifdef WITH_DHCP
+ if (!flag) {
+ const DICT_ATTR *dattr;
+
+ dattr = dict_attrbyname("DHCP-Message-Type");
+
+ /*
+ * Handle each DHCP Message type separately.
+ */
+ if (dattr) for (subcs = cf_subsection_find_next(cs, NULL, "dhcp");
+ subcs != NULL;
+ subcs = cf_subsection_find_next(cs, subcs,
+ "dhcp")) {
+ const char *name2 = cf_section_name2(subcs);
+
+ DEBUG2(" Module: Checking dhcp %s {...} for more modules to load", name2);
+ if (!load_subcomponent_section(NULL, subcs,
+ components,
+ dattr->attr,
+ RLM_COMPONENT_POST_AUTH)) {
+ goto error; /* FIXME: memleak? */
+ }
+ c = lookup_by_index(components,
+ RLM_COMPONENT_POST_AUTH, 0);
+ if (c) server->mc[RLM_COMPONENT_POST_AUTH] = c->modulelist;
+ flag = 1;
+ }
+ }
+#endif