]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Load "server {...}" sections properly
authorAlan T. DeKok <aland@freeradius.org>
Thu, 29 Sep 2011 16:03:23 +0000 (18:03 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 29 Sep 2011 16:03:23 +0000 (18:03 +0200)
src/main/modules.c

index 5dcdc9ec649cecb0f85df939a80a445ddef1e132..b739b79106ac48b4e581f48c4d157fa12752ba5a 100644 (file)
@@ -1220,13 +1220,15 @@ int virtual_servers_load(CONF_SECTION *config)
         *      In either case, load the "default" virtual server first.
         *      this matches better iwth users expectations.
         */
-       cs = cf_section_find_name2(config, "server", NULL);
-       if (!cs) {
-               if (load_byserver(config) < 0) {
+       cs = cf_section_find_name2(cf_subsection_find_next(config, NULL,
+                                                          "server"),
+                                  "server", NULL);
+       if (cs) {
+               if (load_byserver(cs) < 0) {
                        return -1;
                }
        } else {
-               if (load_byserver(cs) < 0) {
+               if (load_byserver(config) < 0) {
                        return -1;
                }
        }