From: Arran Cudbard-Bell Date: Thu, 15 Jun 2017 14:23:45 +0000 (-0400) Subject: Use correct NULL value to skip old style servers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b671588305d04caecf8c71ed002ed3fa56a95b84;p=thirdparty%2Ffreeradius-server.git Use correct NULL value to skip old style servers --- diff --git a/src/main/virtual_servers.c b/src/main/virtual_servers.c index 33564db61ef..519bbcec6f2 100644 --- a/src/main/virtual_servers.c +++ b/src/main/virtual_servers.c @@ -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;