]> 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:50 +0000 (18:03 +0200)
src/main/modules.c

index 2ef969ce58cae32b2b31b326e245e2bbcc245de0..f01531bd75fbe65ee98cb363b2a887cb84362034 100644 (file)
@@ -1280,13 +1280,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;
                }
        }