]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
only open new async listeners if we have them
authorAlan T. DeKok <aland@freeradius.org>
Sat, 17 Jun 2017 13:54:25 +0000 (09:54 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 17 Jun 2017 13:54:25 +0000 (09:54 -0400)
Should hopefully get travis to pass in the short term

src/main/radiusd.c
src/main/virtual_servers.c

index 239131b62b76ad28f1762b21aa9618e926c7dff3..8d1f10995fc0c272849a2dd182b80da2134bebb8 100644 (file)
@@ -550,21 +550,24 @@ int main(int argc, char *argv[])
         */
        if (modules_instantiate(main_config.config) < 0) exit(EXIT_FAILURE);
 
-       sc = fr_schedule_create(NULL, &default_log, 1, 4, (fr_schedule_thread_instantiate_t) modules_thread_instantiate,
-                               main_config.config);
-       if (!sc) {
-               exit(EXIT_FAILURE);
-       }
-
        /*
         *      And then load the virtual servers.
         */
        if (virtual_servers_instantiate(main_config.config) < 0) exit(EXIT_FAILURE);
 
        /*
-        *      If this isn't just a config check, open the sockets
+        *      If this isn't just a config check, AND we have new
+        *      async listeners, then we open the sockets.
         */
-       if (!check_config && virtual_servers_open(sc) < 0) exit(EXIT_FAILURE);
+       if (!check_config && main_config.namespace) {
+               sc = fr_schedule_create(NULL, &default_log, 1, 4, (fr_schedule_thread_instantiate_t) modules_thread_instantiate,
+                                       main_config.config);
+               if (!sc) {
+                       exit(EXIT_FAILURE);
+               }
+
+               if (virtual_servers_open(sc) < 0) exit(EXIT_FAILURE);
+       }
 
        /*
         *      Initialise the SNMP stats structures
index 4edecf3571a7a9c3241d922ac950a005f69ea39f..8176467923eed8c8d4ff95f4c309bee3ed7931c9 100644 (file)
@@ -132,6 +132,11 @@ static int listen_parse(UNUSED TALLOC_CTX *ctx, void *out, CONF_ITEM *ci, UNUSED
        listen->proto_module->module = module;
        listen->proto_module->conf = listen_cs;
 
+       /*
+        *      Hack for now: tell the server core we have new listeners.
+        */
+       main_config.namespace = true;
+
        return 0;
 }