]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use correct NULL value to skip old style servers
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 15 Jun 2017 14:23:45 +0000 (10:23 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 15 Jun 2017 14:23:45 +0000 (10:23 -0400)
src/main/virtual_servers.c

index 33564db61ef69ee7a72f134b86e1557a69e6157a..519bbcec6f2ee4dd19b8ed768e9f4fc89446b4de 100644 (file)
@@ -608,14 +608,14 @@ int virtual_servers_open(fr_schedule_t *sc)
                fr_virtual_listen_t     **listener;
                size_t                  j, listen_cnt;
 
-               if (!virtual_servers[i]) continue;      /* Skip old style */
-
                listener = virtual_servers[i]->listener;
                listen_cnt = talloc_array_length(listener);
 
                for (j = 0; j < listen_cnt; j++) {
                        fr_virtual_listen_t *listen = listener[j];
 
+                       if (!listen->proto_module) continue;    /* Skip old style */
+
                        if (listen->app->open &&
                            listen->app->open(listen->proto_module->inst, sc, listen->proto_module->conf) < 0) {
                                cf_log_err(listen->proto_module->conf, "Opening I/O interface failed");
@@ -661,14 +661,14 @@ int virtual_servers_instantiate(CONF_SECTION *config)
                fr_virtual_listen_t     **listener;
                size_t                  j, listen_cnt;
 
-               if (!virtual_servers[i]) continue;      /* Skip old style */
-
                listener = virtual_servers[i]->listener;
                listen_cnt = talloc_array_length(listener);
 
                for (j = 0; j < listen_cnt; j++) {
                        fr_virtual_listen_t *listen = listener[j];
 
+                       if (!listen->proto_module) continue;    /* Skip old style */
+
                        if (listen->app->instantiate &&
                            listen->app->instantiate(listen->proto_module->inst, listen->proto_module->conf) < 0) {
                                cf_log_err(listen->proto_module->conf, "Instantiate failed");
@@ -743,7 +743,7 @@ int virtual_servers_bootstrap(CONF_SECTION *config)
                fr_virtual_listen_t     **listener;
                size_t                  j, listen_cnt;
 
-               if (!virtual_servers[i] || !virtual_servers[i]->listener) continue;     /* Skip old style */
+               if (!virtual_servers[i] || !virtual_servers[i]->listener) continue;
 
                listener = talloc_get_type_abort(virtual_servers[i]->listener, fr_virtual_listen_t *);
                listen_cnt = talloc_array_length(listener);
@@ -751,6 +751,8 @@ int virtual_servers_bootstrap(CONF_SECTION *config)
                for (j = 0; j < listen_cnt; j++) {
                        fr_virtual_listen_t *listen = talloc_get_type_abort(listener[j], fr_virtual_listen_t);
 
+                       if (!listen->proto_module) continue;    /* Skip old style */
+
                        talloc_get_type_abort(listen->proto_module, dl_submodule_t);
                        listen->app = (fr_app_t const *)listen->proto_module->module->common;