From: Alan T. DeKok Date: Tue, 9 Nov 2021 18:02:30 +0000 (-0500) Subject: remove rlm_ldap_t from fr_ldap_thread_t X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b471a6e37ab4b8c7baa2efe33e8dc8f1496bdca;p=thirdparty%2Ffreeradius-server.git remove rlm_ldap_t from fr_ldap_thread_t the only use of thread->inst uses thread->inst->config, which is already cached in thread->config --- diff --git a/src/lib/ldap/base.h b/src/lib/ldap/base.h index 39b862dbad..34ac0390c0 100644 --- a/src/lib/ldap/base.h +++ b/src/lib/ldap/base.h @@ -354,14 +354,11 @@ typedef struct { int count; //!< Index on next free element. } fr_ldap_map_exp_t; -typedef struct ldap_inst_s rlm_ldap_t; - /** Thread specific structure to manage LDAP trunk connections. * */ typedef struct { fr_rb_tree_t *trunks; //!< Tree of LDAP trunks used by this thread - rlm_ldap_t *inst; //!< Module instance data fr_ldap_config_t *config; //!< Module instance config fr_trunk_conf_t *trunk_conf; //!< Module trunk config fr_event_list_t *el; //!< Thread event list for callbacks / timeouts diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 52b814f819..3b111c7994 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -503,7 +503,7 @@ static xlat_action_t ldap_xlat(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, fr_value_box_t *in_vb = NULL; ldap_xlat_thread_inst_t *xt = talloc_get_type_abort(xlat_thread_inst, ldap_xlat_thread_inst_t); char *host_url; - fr_ldap_config_t const *handle_config = &xt->t->inst->handle_config; + fr_ldap_config_t const *handle_config = xt->t->config; fr_ldap_thread_trunk_t *ttrunk; fr_ldap_query_t *query = NULL; @@ -1777,7 +1777,6 @@ static int mod_thread_instatiate(UNUSED CONF_SECTION const *conf, void *instance */ MEM(this_thread->trunks = fr_rb_inline_talloc_alloc(this_thread, fr_ldap_thread_trunk_t, node, fr_ldap_trunk_cmp, NULL)); - this_thread->inst = inst; this_thread->config = &inst->handle_config; this_thread->trunk_conf = &inst->trunk_conf; this_thread->el = el; diff --git a/src/modules/rlm_ldap/rlm_ldap.h b/src/modules/rlm_ldap/rlm_ldap.h index ea6f83fd59..7ae9969534 100644 --- a/src/modules/rlm_ldap/rlm_ldap.h +++ b/src/modules/rlm_ldap/rlm_ldap.h @@ -17,8 +17,6 @@ #include #include -typedef struct ldap_inst_s rlm_ldap_t; - typedef struct { tmpl_t *mech; //!< SASL mech(s) to try. tmpl_t *proxy; //!< Identity to proxy. @@ -31,7 +29,7 @@ typedef struct { char const *reference; //!< Configuration reference string. } ldap_acct_section_t; -struct ldap_inst_s { +typedef struct { char const *name; //!< Instance name. CONF_SECTION *cs; //!< Main configuration section for this instance. @@ -150,7 +148,7 @@ struct ldap_inst_s { //!< are unavailable. uint32_t ldap_debug; //!< Debug flag for the SDK. -}; +} rlm_ldap_t; extern HIDDEN fr_dict_attr_t const *attr_cleartext_password; extern HIDDEN fr_dict_attr_t const *attr_crypt_password;