]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove rlm_ldap_t from fr_ldap_thread_t
authorAlan T. DeKok <aland@freeradius.org>
Tue, 9 Nov 2021 18:02:30 +0000 (13:02 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 9 Nov 2021 18:21:05 +0000 (13:21 -0500)
the only use of thread->inst uses thread->inst->config, which is
already cached in thread->config

src/lib/ldap/base.h
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_ldap/rlm_ldap.h

index 39b862dbad910135d1f99346bb46847ef9fdb1a1..34ac0390c0575ada81ebb3404d9f32a418786220 100644 (file)
@@ -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
index 52b814f819432e016ae4da6d6ce88a7f3dc01e39..3b111c7994406b0084e82155be927eddbec01ff7 100644 (file)
@@ -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;
index ea6f83fd59fdddd7c4b7958493a8f3b9e7624d24..7ae9969534d2e7396ceed12753e918280f1ece94 100644 (file)
@@ -17,8 +17,6 @@
 #include <freeradius-devel/server/module.h>
 #include <freeradius-devel/ldap/base.h>
 
-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;