From: Arran Cudbard-Bell Date: Thu, 15 Apr 2021 15:11:24 +0000 (-0500) Subject: Last rbtree rename... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=014213df474245cc06cc0cc07766013866b57e95;p=thirdparty%2Ffreeradius-server.git Last rbtree rename... --- diff --git a/src/bin/radclient.c b/src/bin/radclient.c index 39acda865a3..f4deca265ab 100644 --- a/src/bin/radclient.c +++ b/src/bin/radclient.c @@ -1152,7 +1152,7 @@ int main(int argc, char **argv) talloc_set_log_stderr(); - filename_tree = fr_rb_tree_talloc_alloc(NULL, rc_file_pair_t, node, filename_cmp, NULL, 0); + filename_tree = fr_rb_talloc_alloc(NULL, rc_file_pair_t, node, filename_cmp, NULL, 0); if (!filename_tree) { oom: ERROR("Out of memory"); diff --git a/src/bin/radsniff.c b/src/bin/radsniff.c index e291a7893e5..3f75d6b3865 100644 --- a/src/bin/radsniff.c +++ b/src/bin/radsniff.c @@ -2658,7 +2658,7 @@ int main(int argc, char *argv[]) usage(64); } - link_tree = fr_rb_tree_talloc_alloc(conf, rs_request_t, link_node, rs_rtx_cmp, _unmark_link, 0); + link_tree = fr_rb_talloc_alloc(conf, rs_request_t, link_node, rs_rtx_cmp, _unmark_link, 0); if (!link_tree) { ERROR("Failed creating RTX tree"); goto finish; @@ -2716,7 +2716,7 @@ int main(int argc, char *argv[]) /* * Setup the request tree */ - request_tree = fr_rb_tree_talloc_alloc(conf, rs_request_t, request_node, rs_packet_cmp, _unmark_request, 0); + request_tree = fr_rb_talloc_alloc(conf, rs_request_t, request_node, rs_packet_cmp, _unmark_request, 0); if (!request_tree) { ERROR("Failed creating request tree"); goto finish; diff --git a/src/lib/io/master.c b/src/lib/io/master.c index c749049eef1..8f231523cb2 100644 --- a/src/lib/io/master.c +++ b/src/lib/io/master.c @@ -531,7 +531,7 @@ static fr_io_connection_t *fr_io_connection_alloc(fr_io_instance_t const *inst, * #todo - unify the code with static clients? */ if (inst->app_io->track_duplicates) { - MEM(connection->client->table = fr_rb_tree_talloc_alloc(client, fr_io_track_t, node, + MEM(connection->client->table = fr_rb_talloc_alloc(client, fr_io_track_t, node, track_connected_cmp, NULL, RB_FLAG_NONE)); } @@ -1463,7 +1463,7 @@ do_read: */ if (inst->app_io->track_duplicates) { fr_assert(inst->app_io->compare != NULL); - MEM(client->table = fr_rb_tree_talloc_alloc(client, fr_io_track_t, node, track_cmp, + MEM(client->table = fr_rb_talloc_alloc(client, fr_io_track_t, node, track_cmp, NULL, RB_FLAG_NONE)); } @@ -1475,7 +1475,7 @@ do_read: fr_assert(client->state == PR_CLIENT_STATIC); (void) pthread_mutex_init(&client->mutex, NULL); - MEM(client->ht = fr_hash_table_create(client, connection_hash, connection_cmp, NULL)); + MEM(client->ht = fr_hash_table_alloc(client, connection_hash, connection_cmp, NULL)); } /* @@ -2470,7 +2470,7 @@ static ssize_t mod_write(fr_listen_t *li, void *packet_ctx, fr_time_t request_ti * defined. */ (void) pthread_mutex_init(&client->mutex, NULL); - MEM(client->ht = fr_hash_table_create(client, connection_hash, connection_cmp, NULL)); + MEM(client->ht = fr_hash_table_alloc(client, connection_hash, connection_cmp, NULL)); } else { /* diff --git a/src/lib/io/network.c b/src/lib/io/network.c index 4ca6882f167..9ce96da76f9 100644 --- a/src/lib/io/network.c +++ b/src/lib/io/network.c @@ -1663,13 +1663,13 @@ fr_network_t *fr_network_create(TALLOC_CTX *ctx, fr_event_list_t *el, char const /* * Create the various heaps. */ - nr->sockets = fr_rb_tree_talloc_alloc(nr, fr_network_socket_t, listen_node, socket_listen_cmp, NULL, rbflags); + nr->sockets = fr_rb_talloc_alloc(nr, fr_network_socket_t, listen_node, socket_listen_cmp, NULL, rbflags); if (!nr->sockets) { fr_strerror_const_push("Failed creating listen tree for sockets"); goto fail2; } - nr->sockets_by_num = fr_rb_tree_talloc_alloc(nr, fr_network_socket_t, num_node, socket_num_cmp, NULL, rbflags); + nr->sockets_by_num = fr_rb_talloc_alloc(nr, fr_network_socket_t, num_node, socket_num_cmp, NULL, rbflags); if (!nr->sockets_by_num) { fr_strerror_const_push("Failed creating number tree for sockets"); goto fail2; diff --git a/src/lib/io/worker.c b/src/lib/io/worker.c index db1afa544e2..4d0f3442c30 100644 --- a/src/lib/io/worker.c +++ b/src/lib/io/worker.c @@ -1283,7 +1283,7 @@ nomem: goto fail; } - worker->dedup = fr_rb_tree_talloc_alloc(worker, request_t, dedup_node, worker_dedup_cmp, NULL, rbflags); + worker->dedup = fr_rb_talloc_alloc(worker, request_t, dedup_node, worker_dedup_cmp, NULL, rbflags); if (!worker->dedup) { fr_strerror_const("Failed creating de_dup tree"); goto fail; diff --git a/src/lib/server/cf_file.c b/src/lib/server/cf_file.c index 0e6c89b94f5..2c813904922 100644 --- a/src/lib/server/cf_file.c +++ b/src/lib/server/cf_file.c @@ -2305,7 +2305,7 @@ int cf_file_read(CONF_SECTION *cs, char const *filename) p = strrchr(cp->value, FR_DIR_SEP); if (p) *p = '\0'; - MEM(tree = fr_rb_tree_talloc_alloc(cs, cf_file_t, node, _inode_cmp, NULL, 0)); + MEM(tree = fr_rb_talloc_alloc(cs, cf_file_t, node, _inode_cmp, NULL, 0)); cf_data_add(cs, tree, "filename", false); diff --git a/src/lib/server/client.c b/src/lib/server/client.c index b26b77d8131..1d2dfc4a0af 100644 --- a/src/lib/server/client.c +++ b/src/lib/server/client.c @@ -287,7 +287,7 @@ bool client_add(RADCLIENT_LIST *clients, RADCLIENT *client) #else /* WITH_TRIE */ if (!clients->tree[client->ipaddr.prefix]) { - clients->tree[client->ipaddr.prefix] = fr_rb_tree_talloc_alloc(clients, RADCLIENT, node, client_cmp, + clients->tree[client->ipaddr.prefix] = fr_rb_talloc_alloc(clients, RADCLIENT, node, client_cmp, NULL, RB_FLAG_NONE); if (!clients->tree[client->ipaddr.prefix]) { return false; diff --git a/src/lib/server/dl_module.c b/src/lib/server/dl_module.c index d14a5a1b316..629889b386a 100644 --- a/src/lib/server/dl_module.c +++ b/src/lib/server/dl_module.c @@ -655,7 +655,7 @@ dl_module_loader_t *dl_module_loader_init(char const *lib_dir) } dl_search_path_prepend(dl_module_loader->dl_loader, lib_dir); - dl_module_loader->inst_data_tree = fr_rb_tree_talloc_alloc(dl_module_loader, + dl_module_loader->inst_data_tree = fr_rb_talloc_alloc(dl_module_loader, dl_module_inst_t, node, dl_module_inst_data_cmp, NULL, 0); if (!dl_module_loader->inst_data_tree) { @@ -663,7 +663,7 @@ dl_module_loader_t *dl_module_loader_init(char const *lib_dir) goto error; } - dl_module_loader->module_tree = fr_rb_tree_talloc_alloc(dl_module_loader, + dl_module_loader->module_tree = fr_rb_talloc_alloc(dl_module_loader, dl_module_t, node, dl_module_cmp, NULL, 0); if (!dl_module_loader->inst_data_tree) { diff --git a/src/lib/server/map_proc.c b/src/lib/server/map_proc.c index c1fb819926c..46eec521c63 100644 --- a/src/lib/server/map_proc.c +++ b/src/lib/server/map_proc.c @@ -117,7 +117,7 @@ int map_proc_register(void *mod_inst, char const *name, fr_assert(name && name[0]); if (!map_proc_root) { - map_proc_root = fr_rb_tree_talloc_alloc(NULL, map_proc_t, node, + map_proc_root = fr_rb_talloc_alloc(NULL, map_proc_t, node, map_proc_cmp, _map_proc_tree_free, RB_FLAG_REPLACE); if (!map_proc_root) { DEBUG("map_proc: Failed to create tree"); diff --git a/src/lib/server/method.c b/src/lib/server/method.c index 18bc0796fac..923c569ddc7 100644 --- a/src/lib/server/method.c +++ b/src/lib/server/method.c @@ -143,7 +143,7 @@ module_method_set_t *module_method_alloc_set(TALLOC_CTX *ctx) module_method_set_t *set; MEM(set = talloc_zero(ctx, module_method_set_t)); - MEM(set->tree = fr_rb_tree_talloc_alloc(set, module_method_entry_t, node, module_method_cmp, NULL, 0)); + MEM(set->tree = fr_rb_talloc_alloc(set, module_method_entry_t, node, module_method_cmp, NULL, 0)); fr_dlist_talloc_init(&set->list, module_method_entry_t, entry); return set; diff --git a/src/lib/server/state.c b/src/lib/server/state.c index 44b1f88aba7..8a1f62dd857 100644 --- a/src/lib/server/state.c +++ b/src/lib/server/state.c @@ -241,7 +241,7 @@ fr_state_tree_t *fr_state_tree_init(TALLOC_CTX *ctx, fr_dict_attr_t const *da, b * are freed before it's destroyed. Hence * it being parented from the NULL ctx. */ - state->tree = fr_rb_tree_talloc_alloc(NULL, fr_state_entry_t, node, state_entry_cmp, NULL, 0); + state->tree = fr_rb_talloc_alloc(NULL, fr_state_entry_t, node, state_entry_cmp, NULL, 0); if (!state->tree) { talloc_free(state); return NULL; diff --git a/src/lib/server/trigger.c b/src/lib/server/trigger.c index 4b29c6092ac..77c7b926f6c 100644 --- a/src/lib/server/trigger.c +++ b/src/lib/server/trigger.c @@ -149,7 +149,7 @@ int trigger_exec_init(CONF_SECTION const *cs) return 0; } - MEM(trigger_last_fired_tree = fr_rb_tree_talloc_alloc(talloc_null_ctx(), + MEM(trigger_last_fired_tree = fr_rb_talloc_alloc(talloc_null_ctx(), trigger_last_fired_t, node, _trigger_last_fired_cmp, _trigger_last_fired_free, 0)); diff --git a/src/lib/server/virtual_servers.c b/src/lib/server/virtual_servers.c index fb498e71272..334691a7c3b 100644 --- a/src/lib/server/virtual_servers.c +++ b/src/lib/server/virtual_servers.c @@ -1224,7 +1224,7 @@ int virtual_namespace_register(char const *namespace, fr_dict_t const *dict, * so it shouldn't be parented from * virtual_server_root. */ - MEM(vns_tree = fr_rb_tree_talloc_alloc(NULL, + MEM(vns_tree = fr_rb_talloc_alloc(NULL, fr_virtual_namespace_t, node, _virtual_namespace_cmp, _virtual_namespace_free, RB_FLAG_REPLACE)); diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index 7c11483edb7..db151b0ec6f 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -3075,7 +3075,7 @@ int xlat_init(void) /* * Create the function tree */ - xlat_root = fr_rb_tree_talloc_alloc(NULL, xlat_t, node, xlat_cmp, _xlat_func_tree_free, RB_FLAG_REPLACE); + xlat_root = fr_rb_talloc_alloc(NULL, xlat_t, node, xlat_cmp, _xlat_func_tree_free, RB_FLAG_REPLACE); if (!xlat_root) { ERROR("%s: Failed to create tree", __FUNCTION__); return -1; diff --git a/src/lib/unlang/xlat_inst.c b/src/lib/unlang/xlat_inst.c index 0c6753411ee..00cc0fbd902 100644 --- a/src/lib/unlang/xlat_inst.c +++ b/src/lib/unlang/xlat_inst.c @@ -349,7 +349,7 @@ int xlat_thread_instantiate(TALLOC_CTX *ctx) if (!xlat_inst_tree) return 0; if (!xlat_thread_inst_tree) { - MEM(xlat_thread_inst_tree = fr_rb_tree_talloc_alloc(ctx, xlat_thread_inst_t, inst_node, + MEM(xlat_thread_inst_tree = fr_rb_talloc_alloc(ctx, xlat_thread_inst_t, inst_node, _xlat_thread_inst_cmp, _xlat_thread_inst_free, 0)); } @@ -386,7 +386,7 @@ static int xlat_instantiate_init(void) { if (xlat_inst_tree) return 0; - xlat_inst_tree = fr_rb_tree_talloc_alloc(NULL, xlat_inst_t, inst_node, + xlat_inst_tree = fr_rb_talloc_alloc(NULL, xlat_inst_t, inst_node, _xlat_inst_cmp, _xlat_inst_free, RB_FLAG_NONE); if (!xlat_inst_tree) return -1; diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index dc6b32446c1..0e2bfc0505d 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -455,7 +455,7 @@ static inline CC_HINT(always_inline) int dict_attr_namespace_init(fr_dict_attr_t * namespace hash table. */ if (!ext->namespace) { - ext->namespace = fr_hash_table_create(*da_p, dict_attr_name_hash, dict_attr_name_cmp, NULL); + ext->namespace = fr_hash_table_alloc(*da_p, dict_attr_name_hash, dict_attr_name_cmp, NULL); if (!ext->namespace) { fr_strerror_printf("Failed allocating \"namespace\" table"); return -1; @@ -1222,13 +1222,13 @@ int dict_attr_enum_add_name(fr_dict_attr_t *da, char const *name, * Initialise enumv hash tables */ if (!ext->value_by_name || !ext->name_by_value) { - ext->value_by_name = fr_hash_table_create(da, dict_enum_name_hash, dict_enum_name_cmp, hash_pool_free); + ext->value_by_name = fr_hash_table_alloc(da, dict_enum_name_hash, dict_enum_name_cmp, hash_pool_free); if (!ext->value_by_name) { fr_strerror_printf("Failed allocating \"value_by_name\" table"); return -1; } - ext->name_by_value = fr_hash_table_create(da, dict_enum_value_hash, dict_enum_value_cmp, NULL); + ext->name_by_value = fr_hash_table_alloc(da, dict_enum_value_hash, dict_enum_value_cmp, NULL); if (!ext->name_by_value) { fr_strerror_printf("Failed allocating \"name_by_value\" table"); return -1; @@ -2937,7 +2937,7 @@ fr_dict_t *dict_alloc(TALLOC_CTX *ctx) * Create the table of vendor by name. There MAY NOT * be multiple vendors of the same name. */ - dict->vendors_by_name = fr_hash_table_create(dict, dict_vendor_name_hash, dict_vendor_name_cmp, hash_pool_free); + dict->vendors_by_name = fr_hash_table_alloc(dict, dict_vendor_name_hash, dict_vendor_name_cmp, hash_pool_free); if (!dict->vendors_by_name) { fr_strerror_printf("Failed allocating \"vendors_by_name\" table"); goto error; @@ -2947,7 +2947,7 @@ fr_dict_t *dict_alloc(TALLOC_CTX *ctx) * be vendors of the same value. If there are, we * pick the latest one. */ - dict->vendors_by_num = fr_hash_table_create(dict, dict_vendor_pen_hash, dict_vendor_pen_cmp, NULL); + dict->vendors_by_num = fr_hash_table_alloc(dict, dict_vendor_pen_hash, dict_vendor_pen_cmp, NULL); if (!dict->vendors_by_num) { fr_strerror_printf("Failed allocating \"vendors_by_num\" table"); goto error; @@ -2956,7 +2956,7 @@ fr_dict_t *dict_alloc(TALLOC_CTX *ctx) /* * Inter-dictionary reference caching */ - dict->autoref = fr_hash_table_create(dict, dict_protocol_name_hash, dict_protocol_name_cmp, NULL); + dict->autoref = fr_hash_table_alloc(dict, dict_protocol_name_hash, dict_protocol_name_cmp, NULL); if (!dict->autoref) { fr_strerror_printf("Failed allocating \"autoref\" table"); goto error; @@ -3340,7 +3340,7 @@ fr_dict_gctx_t const *fr_dict_global_ctx_init(TALLOC_CTX *ctx, char const *dict_ return NULL; } - new_ctx->protocol_by_name = fr_hash_table_create(new_ctx, dict_protocol_name_hash, dict_protocol_name_cmp, NULL); + new_ctx->protocol_by_name = fr_hash_table_alloc(new_ctx, dict_protocol_name_hash, dict_protocol_name_cmp, NULL); if (!new_ctx->protocol_by_name) { fr_strerror_const("Failed initializing protocol_by_name hash"); error: @@ -3348,7 +3348,7 @@ fr_dict_gctx_t const *fr_dict_global_ctx_init(TALLOC_CTX *ctx, char const *dict_ return NULL; } - new_ctx->protocol_by_num = fr_hash_table_create(new_ctx, dict_protocol_num_hash, dict_protocol_num_cmp, NULL); + new_ctx->protocol_by_num = fr_hash_table_alloc(new_ctx, dict_protocol_num_hash, dict_protocol_num_cmp, NULL); if (!new_ctx->protocol_by_num) { fr_strerror_const("Failed initializing protocol_by_num hash"); goto error; diff --git a/src/lib/util/dl.c b/src/lib/util/dl.c index feca5ac48ff..06a6e32e17c 100644 --- a/src/lib/util/dl.c +++ b/src/lib/util/dl.c @@ -795,7 +795,7 @@ dl_loader_t *dl_loader_init(TALLOC_CTX *ctx, void *uctx, bool uctx_free, bool de return NULL; } - dl_loader->tree = fr_rb_tree_talloc_alloc(dl_loader, dl_t, node, dl_handle_cmp, NULL, 0); + dl_loader->tree = fr_rb_talloc_alloc(dl_loader, dl_t, node, dl_handle_cmp, NULL, 0); if (!dl_loader->tree) { fr_strerror_const("Failed initialising dl->tree"); error: diff --git a/src/lib/util/event.c b/src/lib/util/event.c index 7cfe21e3eb7..a93fd7ccfdb 100644 --- a/src/lib/util/event.c +++ b/src/lib/util/event.c @@ -2281,7 +2281,7 @@ fr_event_list_t *fr_event_list_alloc(TALLOC_CTX *ctx, fr_event_status_cb_t statu return NULL; } - el->fds = fr_rb_tree_talloc_alloc(el, fr_event_fd_t, node, fr_event_fd_cmp, NULL, 0); + el->fds = fr_rb_talloc_alloc(el, fr_event_fd_t, node, fr_event_fd_cmp, NULL, 0); if (!el->fds) { fr_strerror_const("Failed allocating FD tree"); goto error; diff --git a/src/lib/util/hash.c b/src/lib/util/hash.c index 99afb17b43a..f36b6e9ead5 100644 --- a/src/lib/util/hash.c +++ b/src/lib/util/hash.c @@ -279,7 +279,7 @@ static int _fr_hash_table_free(fr_hash_table_t *ht) * * Memory usage in bytes is (20/3) * number of entries. */ -fr_hash_table_t *fr_hash_table_create(TALLOC_CTX *ctx, +fr_hash_table_t *fr_hash_table_alloc(TALLOC_CTX *ctx, fr_hash_t hash_func, fr_cmp_t cmp_func, fr_free_t free_func) @@ -871,7 +871,7 @@ int main(int argc, char **argv) fr_hash_table_t *ht; int *array; - ht = fr_hash_table_create(NULL, hash_int, NULL, NULL); + ht = fr_hash_table_alloc(NULL, hash_int, NULL, NULL); if (!ht) { fprintf(stderr, "Hash create failed\n"); fr_exit(1); diff --git a/src/lib/util/hash.h b/src/lib/util/hash.h index 21e202471f8..c967ef2e375 100644 --- a/src/lib/util/hash.h +++ b/src/lib/util/hash.h @@ -54,7 +54,7 @@ uint32_t fr_hash_case_string(char const *p); typedef struct fr_hash_table_s fr_hash_table_t; typedef int (*fr_hash_table_walk_t)(void *data, void *uctx); -fr_hash_table_t *fr_hash_table_create(TALLOC_CTX *ctx, +fr_hash_table_t *fr_hash_table_alloc(TALLOC_CTX *ctx, fr_hash_t hashNode, fr_cmp_t cmpNode, fr_free_t freeNode); diff --git a/src/lib/util/rb.h b/src/lib/util/rb.h index a7167a8f901..4f2a466cfb1 100644 --- a/src/lib/util/rb.h +++ b/src/lib/util/rb.h @@ -71,7 +71,7 @@ struct fr_rb_node_s { * - A new rbtree on success. * - NULL on failure. */ -#define fr_rb_tree_talloc_alloc(_ctx, _type, _field, _cmp, _node_free, _flags) \ +#define fr_rb_talloc_alloc(_ctx, _type, _field, _cmp, _node_free, _flags) \ _Generic((((_type *)0)->_field), \ fr_rb_node_t: _fr_rb_alloc(_ctx, offsetof(_type, _field), #_type, _cmp, _node_free, _flags) \ ) diff --git a/src/modules/proto_bfd/proto_bfd.c b/src/modules/proto_bfd/proto_bfd.c index 04aa389a5eb..476fe7da2c3 100644 --- a/src/modules/proto_bfd/proto_bfd.c +++ b/src/modules/proto_bfd/proto_bfd.c @@ -1715,7 +1715,7 @@ static int bfd_socket_parse(CONF_SECTION *cs, rad_listen_t *this) } } - sock->session_tree = fr_rb_tree_talloc_alloc(sock, bfd_state_t, node, bfd_session_cmp, bfd_session_free, 0); + sock->session_tree = fr_rb_talloc_alloc(sock, bfd_state_t, node, bfd_session_cmp, bfd_session_free, 0); if (!sock->session_tree) { ERROR("Failed creating session tree!"); return -1; diff --git a/src/modules/proto_ldap_sync/sync.c b/src/modules/proto_ldap_sync/sync.c index 7666094acca..4b2517b8747 100644 --- a/src/modules/proto_ldap_sync/sync.c +++ b/src/modules/proto_ldap_sync/sync.c @@ -994,7 +994,7 @@ int sync_state_init(fr_ldap_connection_t *conn, sync_config_t const *config, * these are specific to the connection. */ if (!conn->uctx) { - MEM(tree = fr_rb_tree_talloc_alloc(conn, sync_state_t, node, _sync_cmp, NULL, RB_FLAG_NONE)); + MEM(tree = fr_rb_talloc_alloc(conn, sync_state_t, node, _sync_cmp, NULL, RB_FLAG_NONE)); conn->uctx = tree; } else { tree = talloc_get_type_abort(conn->uctx, fr_rb_tree_t); diff --git a/src/modules/rlm_cache/drivers/rlm_cache_rbtree/rlm_cache_rbtree.c b/src/modules/rlm_cache/drivers/rlm_cache_rbtree/rlm_cache_rbtree.c index e7261bec6fa..1da924da76b 100644 --- a/src/modules/rlm_cache/drivers/rlm_cache_rbtree/rlm_cache_rbtree.c +++ b/src/modules/rlm_cache/drivers/rlm_cache_rbtree/rlm_cache_rbtree.c @@ -108,7 +108,7 @@ static int mod_instantiate(void *instance, UNUSED CONF_SECTION *conf) /* * The cache. */ - driver->cache = fr_rb_tree_talloc_alloc(NULL, rlm_cache_rb_entry_t, node, cache_entry_cmp, NULL, 0); + driver->cache = fr_rb_talloc_alloc(NULL, rlm_cache_rb_entry_t, node, cache_entry_cmp, NULL, 0); if (!driver->cache) { ERROR("Failed to create cache"); return -1; diff --git a/src/modules/rlm_csv/rlm_csv.c b/src/modules/rlm_csv/rlm_csv.c index 39482d5c1f0..59bc4451676 100644 --- a/src/modules/rlm_csv/rlm_csv.c +++ b/src/modules/rlm_csv/rlm_csv.c @@ -567,7 +567,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *conf) (inst->key_data_type == FR_TYPE_IPV6_ADDR) || (inst->key_data_type == FR_TYPE_IPV6_PREFIX)) { MEM(inst->trie = fr_trie_alloc(inst)); } else { - MEM(inst->tree = fr_rb_tree_talloc_alloc(inst, rlm_csv_entry_t, node, csv_entry_cmp, NULL, 0)); + MEM(inst->tree = fr_rb_talloc_alloc(inst, rlm_csv_entry_t, node, csv_entry_cmp, NULL, 0)); } if ((*inst->index_field_name == ',') || (*inst->index_field_name == *inst->delimiter)) { diff --git a/src/modules/rlm_detail/rlm_detail.c b/src/modules/rlm_detail/rlm_detail.c index ee284674544..8a1d9840af0 100644 --- a/src/modules/rlm_detail/rlm_detail.c +++ b/src/modules/rlm_detail/rlm_detail.c @@ -160,7 +160,7 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) if (cs) { CONF_ITEM *ci; - inst->ht = fr_hash_table_create(inst, detail_hash, detail_cmp, NULL); + inst->ht = fr_hash_table_alloc(inst, detail_hash, detail_cmp, NULL); for (ci = cf_item_next(cs, NULL); ci != NULL; diff --git a/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c b/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c index 4c4e82df3c1..3707d881a0c 100644 --- a/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c +++ b/src/modules/rlm_isc_dhcp/rlm_isc_dhcp.c @@ -1482,7 +1482,7 @@ static int parse_host(rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info * thousands of "host" entries in the parent->child list. */ if (!parent->hosts_by_ether) { - parent->hosts_by_ether = fr_hash_table_create(parent, host_ether_hash, host_ether_cmp, NULL); + parent->hosts_by_ether = fr_hash_table_alloc(parent, host_ether_hash, host_ether_cmp, NULL); if (!parent->hosts_by_ether) { return -1; } @@ -1499,7 +1499,7 @@ static int parse_host(rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info */ if (my_uid) { if (!parent->hosts_by_uid) { - parent->hosts_by_uid = fr_hash_table_create(parent, host_uid_hash, host_uid_cmp, NULL); + parent->hosts_by_uid = fr_hash_table_alloc(parent, host_uid_hash, host_uid_cmp, NULL); if (!parent->hosts_by_uid) { return -1; } @@ -2192,10 +2192,10 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf) fr_pair_list_init(&info->options); info->last = &(info->child); - inst->hosts_by_ether = fr_hash_table_create(inst, host_ether_hash, host_ether_cmp, NULL); + inst->hosts_by_ether = fr_hash_table_alloc(inst, host_ether_hash, host_ether_cmp, NULL); if (!inst->hosts_by_ether) return -1; - inst->hosts_by_uid = fr_hash_table_create(inst, host_uid_hash, host_uid_cmp, NULL); + inst->hosts_by_uid = fr_hash_table_alloc(inst, host_uid_hash, host_uid_cmp, NULL); if (!inst->hosts_by_uid) return -1; ret = read_file(inst, info, inst->filename); diff --git a/src/modules/rlm_radius/track.c b/src/modules/rlm_radius/track.c index 3f00922b9c5..d0da9cbfd11 100644 --- a/src/modules/rlm_radius/track.c +++ b/src/modules/rlm_radius/track.c @@ -160,7 +160,7 @@ retry: * If needed, allocate a subtree. */ if (!tt->subtree[tt->next_id]) { - MEM(tt->subtree[tt->next_id] = fr_rb_tree_talloc_alloc(tt, radius_track_entry_t, node, + MEM(tt->subtree[tt->next_id] = fr_rb_talloc_alloc(tt, radius_track_entry_t, node, te_cmp, NULL, RB_FLAG_NONE)); } diff --git a/src/modules/rlm_securid/rlm_securid.c b/src/modules/rlm_securid/rlm_securid.c index 253335be05e..bc79eb20dd0 100644 --- a/src/modules/rlm_securid/rlm_securid.c +++ b/src/modules/rlm_securid/rlm_securid.c @@ -451,7 +451,7 @@ static int mod_instantiate(void *instance, UNUSED CONF_SECTION *conf) * Lookup sessions in the tree. We don't free them in * the tree, as that's taken care of elsewhere... */ - inst->session_tree = fr_rb_tree_talloc_alloc(NULL, SECURID_SESSION, node, securid_session_cmp, NULL, 0); + inst->session_tree = fr_rb_talloc_alloc(NULL, SECURID_SESSION, node, securid_session_cmp, NULL, 0); if (!inst->session_tree) { ERROR("Cannot initialize session tree"); return -1; diff --git a/src/modules/rlm_sigtran/sccp.c b/src/modules/rlm_sigtran/sccp.c index df2b307f6e0..3c07e8a7bd0 100644 --- a/src/modules/rlm_sigtran/sccp.c +++ b/src/modules/rlm_sigtran/sccp.c @@ -376,7 +376,7 @@ int sigtran_sccp_global_init(void) return 0; } - txn_tree = fr_rb_tree_talloc_alloc(NULL, sigtran_transaction_t, node, sigtran_txn_cmp, false, 0); + txn_tree = fr_rb_talloc_alloc(NULL, sigtran_transaction_t, node, sigtran_txn_cmp, false, 0); if (!txn_tree) return -1; txn_tree_inst++; diff --git a/src/modules/rlm_stats/rlm_stats.c b/src/modules/rlm_stats/rlm_stats.c index 6a9066f7c85..da78b267e90 100644 --- a/src/modules/rlm_stats/rlm_stats.c +++ b/src/modules/rlm_stats/rlm_stats.c @@ -352,8 +352,8 @@ static int mod_thread_instantiate(UNUSED CONF_SECTION const *cs, void *instance, t->inst = inst; - t->src = fr_rb_tree_talloc_alloc(t, rlm_stats_data_t, src_node, data_cmp, NULL, RB_FLAG_LOCK); - t->dst = fr_rb_tree_talloc_alloc(t, rlm_stats_data_t, dst_node, data_cmp, NULL, RB_FLAG_LOCK); + t->src = fr_rb_talloc_alloc(t, rlm_stats_data_t, src_node, data_cmp, NULL, RB_FLAG_LOCK); + t->dst = fr_rb_talloc_alloc(t, rlm_stats_data_t, dst_node, data_cmp, NULL, RB_FLAG_LOCK); pthread_mutex_lock(&inst->mutex); fr_dlist_insert_head(&inst->list, t);