]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move request->dict to proto_dict and local_dict
authorAlan T. DeKok <aland@freeradius.org>
Sat, 12 Apr 2025 18:44:00 +0000 (14:44 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 13 Apr 2025 10:50:27 +0000 (06:50 -0400)
in order to split uses of base protocol dictionary, and
dictionary with local variables.

The protocol dictionary is used for encoding / decoding,
including xlats, and attributes read from external modules such as SQL or LDAP.

The local dictionary is used for local variables

it is saved, updated, and restored every time the interpreter
defines a local attribute

update request_init() to set dict to internal if it isn't passed
in.

update nearly all references to run-time parsing from request->dict
to request->local_dict.  Only the protocol encoders are left
unchanged.

this means that maps, %debug() etc. can now reference local
attributes, which they couldn't before.

update %eval() to use the local dict, too.

update fr_listen_t to have a dict, so the worker thread can use it.

and don't set request->dict in the listen decode any more.

75 files changed:
src/bin/unit_test_module.c
src/lib/io/listen.h
src/lib/io/network.c
src/lib/io/worker.c
src/lib/ldap/map.c
src/lib/redis/redis.c
src/lib/server/log.c
src/lib/server/map.c
src/lib/server/map_async.c
src/lib/server/pair_server_tests.c
src/lib/server/request.c
src/lib/server/request.h
src/lib/server/tmpl_dcursor_tests.c
src/lib/server/trigger.c
src/lib/tls/cache.c
src/lib/unlang/caller.c
src/lib/unlang/compile.c
src/lib/unlang/edit.c
src/lib/unlang/interpret.c
src/lib/unlang/io.c
src/lib/unlang/parallel.c
src/lib/unlang/xlat_builtin.c
src/lib/unlang/xlat_eval.c
src/lib/unlang/xlat_pair.c
src/lib/unlang/xlat_purify.c
src/lib/util/dict.h
src/lib/util/dict_util.c
src/listen/arp/proto_arp.c
src/listen/bfd/proto_bfd.c
src/listen/cron/proto_cron.c
src/listen/cron/proto_cron_crontab.c
src/listen/detail/proto_detail.c
src/listen/dhcpv4/proto_dhcpv4.c
src/listen/dhcpv6/proto_dhcpv6.c
src/listen/dns/proto_dns.c
src/listen/ldap_sync/proto_ldap_sync.c
src/listen/load/proto_load.c
src/listen/load/proto_load_step.c
src/listen/radius/proto_radius.c
src/listen/tacacs/proto_tacacs.c
src/listen/vmps/proto_vmps.c
src/modules/rlm_cache/drivers/rlm_cache_memcached/rlm_cache_memcached.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_client/rlm_client.c
src/modules/rlm_csv/rlm_csv.c
src/modules/rlm_dict/rlm_dict.c
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_eap/types/rlm_eap_peap/peap.c
src/modules/rlm_exec/rlm_exec.c
src/modules/rlm_json/rlm_json.c
src/modules/rlm_ldap/groups.c
src/modules/rlm_ldap/profile.c
src/modules/rlm_linelog/rlm_linelog.c
src/modules/rlm_lua/lua.c
src/modules/rlm_mruby/rlm_mruby.c
src/modules/rlm_passwd/rlm_passwd.c
src/modules/rlm_perl/rlm_perl.c
src/modules/rlm_python/rlm_python.c
src/modules/rlm_radius/bio.c
src/modules/rlm_rest/rest.c
src/modules/rlm_sql/sql.c
src/modules/rlm_stats/rlm_stats.c
src/modules/rlm_yubikey/rlm_yubikey.c
src/process/arp/base.c
src/process/bfd/base.c
src/process/dhcpv4/base.c
src/process/dhcpv6/base.c
src/process/dns/base.c
src/process/ldap_sync/base.c
src/process/radius/base.c
src/process/tacacs/base.c
src/process/test/base.c
src/process/tls/base.c
src/process/ttls/base.c
src/process/vmps/base.c

index ee6a98a971b19ea8ae4642a228cf9341c0b00148..6adcaf6713eb36eaab7089be20595ec0c66737ed 100644 (file)
@@ -190,35 +190,28 @@ static request_t *request_from_file(TALLOC_CTX *ctx, FILE *fp, fr_client_t *clie
 
        static int      number = 0;
 
-       /*
-        *      Create and initialize the new request.
-        */
-       request = request_local_alloc_external(ctx, NULL);
-
-       /*
-        *      FIXME - Should be less RADIUS centric, but everything
-        *      else assumes RADIUS at the moment so we can fix this later.
-        */
-       request->dict = dict_protocol;
-       if (!request->dict) {
+       if (!dict_protocol) {
                fr_strerror_printf_push("%s dictionary failed to load", PROTOCOL_NAME);
-       error:
-               talloc_free(request);
                return NULL;
        }
 
+       /*
+        *      Create and initialize the new request.
+        */
+       request = request_local_alloc_external(ctx, (&(request_init_args_t){ .namespace = dict_protocol }));
+
        request->packet = fr_packet_alloc(request, false);
        if (!request->packet) {
+       oom:
                fr_strerror_const("No memory");
-               goto error;
+       error:
+               talloc_free(request);
+               return NULL;
        }
        request->packet->timestamp = fr_time();
 
        request->reply = fr_packet_alloc(request, false);
-       if (!request->reply) {
-               fr_strerror_const("No memory");
-               goto error;
-       }
+       if (!request->reply) goto oom;
 
        request->client = client;
        request->number = number++;
@@ -606,7 +599,7 @@ static request_t *request_clone(request_t *old, int number, CONF_SECTION *server
 {
        request_t *request;
 
-       request = request_alloc_internal(NULL, NULL);
+       request = request_alloc_internal(NULL, (&(request_init_args_t){ .namespace = old->proto_dict }));
        if (!request) return NULL;
 
        if (!request->packet) request->packet = fr_packet_alloc(request, false);
@@ -621,7 +614,6 @@ static request_t *request_clone(request_t *old, int number, CONF_SECTION *server
        unlang_call_push(request, server_cs, UNLANG_TOP_FRAME);
 
        request->master_state = REQUEST_ACTIVE;
-       request->dict = old->dict;
 
        return request;
 }
index e4f5948994e85c9193ef057eb04fe597e3df5341..b75586f50a3e795edadbc6dac5837b1c8408d907 100644 (file)
@@ -27,6 +27,7 @@ struct fr_listen {
 
        int                     fd;                     //!< file descriptor for this socket - set by open
        char const              *name;                  //!< printable name for this socket - set by open
+       fr_dict_t const         *dict;                  //!< dictionary for this listener
 
        fr_app_io_t const       *app_io;                //!< I/O path functions.
        void const              *app_io_instance;       //!< I/O path configuration context.
index b74c422b5dfc91ac6b0eb369268217701debb328..f7828609b9aac5a722c9ffb34561b1184d5986de 100644 (file)
@@ -237,6 +237,18 @@ int fr_network_listen_add(fr_network_t *nr, fr_listen_t *li)
 {
        fr_ring_buffer_t *rb;
 
+       /*
+        *      Associate the protocol dictionary with the listener, so that the decode functions can check /
+        *      use it.
+        *
+        *      A virtual server may start off with a "dictionary" block, and therefore define a local
+        *      dictionary.  So the "root" dictionary of a virtual server may not be a protocol dict.
+        */
+       fr_assert(li->server_cs != NULL);
+       li->dict = fr_dict_proto_dict(virtual_server_dict_by_cs(li->server_cs));
+
+       fr_assert(li->dict != NULL);
+
        /*
         *      Skip a bunch of work if we're already in the network thread.
         */
index cc85dfffb0eb2b9a378d476bd3a2e34e3a956afe..fdc60ca29b8687dfacb49b798b30dfd5b66f43d6 100644 (file)
@@ -803,11 +803,17 @@ static void worker_request_bootstrap(fr_worker_t *worker, fr_channel_data_t *cd,
        int                     ret = -1;
        request_t               *request;
        TALLOC_CTX              *ctx;
-       fr_listen_t const       *listen;
+       fr_listen_t             *listen = cd->listen;
 
        if (fr_minmax_heap_num_elements(worker->time_order) >= (uint32_t) worker->config.max_requests) goto nak;
 
-       ctx = request = request_alloc_external(NULL, NULL);
+       /*
+        *      Receive a message to the worker queue, and decode it
+        *      to a request.
+        */
+       fr_assert(listen != NULL);
+
+       ctx = request = request_alloc_external(NULL, (&(request_init_args_t){ .namespace = listen->dict }));
        if (!request) goto nak;
 
        worker_request_init(worker, request, now);
@@ -820,12 +826,6 @@ static void worker_request_bootstrap(fr_worker_t *worker, fr_channel_data_t *cd,
 
        request->packet->timestamp = cd->request.recv_time; /* Legacy - Remove once everything looks at request->async */
 
-       /*
-        *      Receive a message to the worker queue, and decode it
-        *      to a request.
-        */
-       fr_assert(cd->listen != NULL);
-
        /*
         *      Update the transport-specific fields.
         */
@@ -833,10 +833,9 @@ static void worker_request_bootstrap(fr_worker_t *worker, fr_channel_data_t *cd,
 
        request->async->recv_time = cd->request.recv_time;
 
-       request->async->listen = cd->listen;
+       request->async->listen = listen;
        request->async->packet_ctx = cd->packet_ctx;
        request->async->priority = cd->priority;
-       listen = request->async->listen;
 
        /*
         *      Now that the "request" structure has been initialized, go decode the packet.
index 7c2fb9d628db5f5566e2819d8cbff50fb6d7b3a3..956b436c0f284d2cb4e87c59845ae5f598be1357 100644 (file)
@@ -67,7 +67,7 @@ int fr_ldap_map_getvalue(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *reques
 
                        tmpl_rules_t    lhs_rules = {
                                .attr = {
-                                       .dict_def = request->dict,
+                                       .dict_def = request->local_dict,
                                        .request_def = tmpl_request(map->lhs),
                                        .list_def = tmpl_list(map->lhs),
                                },
@@ -79,7 +79,7 @@ int fr_ldap_map_getvalue(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *reques
 
                        tmpl_rules_t rhs_rules = {
                                .attr = {
-                                       .dict_def = request->dict
+                                       .dict_def = request->local_dict
                                },
                                .xlat = {
                                        .runtime_el = lhs_rules.xlat.runtime_el,
@@ -341,7 +341,7 @@ int fr_ldap_map_do(request_t *request, char const *check_attr,
                int             count, i;
                tmpl_rules_t const parse_rules = {
                        .attr = {
-                               .dict_def = request->dict,
+                               .dict_def = request->proto_dict,
                                .list_def = request_attr_request,
                        },
                        .xlat = {
@@ -452,7 +452,7 @@ int fr_ldap_map_do(request_t *request, char const *check_attr,
 
                        tmpl_rules_t const parse_rules = {
                                .attr = {
-                                       .dict_def = request->dict,
+                                       .dict_def = request->proto_dict,
                                        .list_def = request_attr_request,
                                },
                                .xlat = {
index 7c5beedf6a2f27aed1e03ee3e33a06f21fd63920..d340c86e25d6c1cb3d0572834c4f0bbeba13c049 100644 (file)
@@ -395,7 +395,7 @@ int fr_redis_reply_to_map(TALLOC_CTX *ctx, map_list_t *out, request_t *request,
        slen = tmpl_afrom_attr_str(map, NULL, &map->lhs, key->str,
                                   &(tmpl_rules_t){
                                        .attr = {
-                                               .dict_def = request->dict,
+                                               .dict_def = request->proto_dict,
                                                .list_def = request_attr_request
                                        }
                                   });
index afe1599db87be1d60745ce3f4bd8b091c0698d50..80c525d612317817f82603d2de1ae935656aa6b8 100644 (file)
@@ -860,7 +860,7 @@ void log_request_proto_pair_list(fr_log_lvl_t lvl, request_t *request,
        fr_pair_list_foreach(vps, vp) {
                PAIR_VERIFY(vp);
 
-               if (!fr_dict_attr_common_parent(fr_dict_root(request->dict), vp->da, true)) continue;
+               if (!fr_dict_attr_common_parent(fr_dict_root(request->proto_dict), vp->da, true)) continue;
 
                log_request_pair(lvl, request, parent, vp, prefix);
        }
index e7bd83afc2c16552cb1b26061a8ab9a9a9ce1041..1110c9aff26515a23e6e09d292d03cbad008b21a 100644 (file)
@@ -1921,7 +1921,7 @@ int map_to_request(request_t *request, map_t const *map, radius_map_getvalue_t f
                slen = tmpl_afrom_attr_str(tmp_ctx, NULL, &exp_lhs, attr_str,
                                           &(tmpl_rules_t){
                                                .attr = {
-                                                       .dict_def = request->dict,
+                                                       .dict_def = request->local_dict,
                                                        .list_def = request_attr_request,
                                                }
                                           });
index e40ffd2e362f803aec9d548d0d3691698be8791c..9370df2aa12073e0fd24ce3bc9b0fad032830010 100644 (file)
@@ -320,7 +320,7 @@ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out,
                slen = tmpl_afrom_attr_str(tmp_ctx, NULL, &map_tmp.lhs, lhs_result_head->vb_strvalue,
                                           &(tmpl_rules_t){
                                                .attr = {
-                                                       .dict_def = request->dict,
+                                                       .dict_def = request->local_dict,
                                                        .list_def = request_attr_request,
                                                }
                                           });
@@ -709,7 +709,7 @@ int map_to_list_mod(TALLOC_CTX *ctx, vp_list_mod_t **out,
                /*
                 *      Parse the VPs from the RHS.
                 */
-               fr_pair_list_afrom_box(ctx, &vp_head, request->dict, rhs_result_head);
+               fr_pair_list_afrom_box(ctx, &vp_head, request->proto_dict, rhs_result_head);
                if (fr_pair_list_empty(&vp_head)) {
                        talloc_free(n);
                        RDEBUG2("No pairs returned by exec");
index 8bd74fc53c14ce176f39e15b1a61b9ce3e6bb4d3..c60c31c0301f46ab3de9a0098da23b18c0d9d300 100644 (file)
@@ -79,7 +79,7 @@ static request_t *request_fake_alloc(void)
        /*
         *      Create and initialize the new request.
         */
-       request = request_local_alloc_external(autofree, NULL);
+       request = request_local_alloc_external(autofree, (&(request_init_args_t){ .namespace = test_dict }));
 
        request->packet = fr_packet_alloc(request, false);
        TEST_CHECK(request->packet != NULL);
index 91cfebee5ad5df016cc62e07cc05f50d46f556a1..6fd2371ef81178908769a6d15a4a273cc8ec5291 100644 (file)
@@ -31,8 +31,6 @@ RCSID("$Id$")
 #include <freeradius-devel/util/debug.h>
 #include <freeradius-devel/util/atexit.h>
 
-static request_init_args_t     default_args;
-
 static fr_dict_t const *dict_freeradius;
 
 extern fr_dict_autoload_t request_dict[];
@@ -198,7 +196,10 @@ static inline CC_HINT(always_inline) int request_detachable_init(request_t *chil
 static inline CC_HINT(always_inline) int request_child_init(request_t *child, request_t *parent)
 {
        child->number = parent->child_number++;
-       if (!child->dict) child->dict = parent->dict;
+       if (!child->proto_dict) {
+               child->proto_dict = parent->proto_dict;
+               child->local_dict = parent->proto_dict;
+       }
 
        if ((parent->seq_start == 0) || (parent->number == parent->seq_start)) {
                child->name = talloc_typed_asprintf(child, "%s.%" PRIu64, parent->name, child->number);
@@ -243,16 +244,28 @@ static inline CC_HINT(always_inline) int request_init(char const *file, int line
                                                      request_t *request, request_type_t type,
                                                      request_init_args_t const *args)
 {
+       fr_dict_t const *dict;
 
        /*
         *      Sanity checks for different requests types
         */
        switch (type) {
        case REQUEST_TYPE_EXTERNAL:
+               fr_assert(args);
+
                if (!fr_cond_assert_msg(!args->parent, "External requests must NOT have a parent")) return -1;
+
+               fr_assert(args->namespace);
+
+               dict = args->namespace;
                break;
 
        case REQUEST_TYPE_INTERNAL:
+               if (!args || !args->namespace) {
+                       dict = fr_dict_internal();
+               } else {
+                       dict = args->namespace;
+               }
                break;
 
        case REQUEST_TYPE_DETACHED:
@@ -267,10 +280,11 @@ static inline CC_HINT(always_inline) int request_init(char const *file, int line
 #endif
                .type = type,
                .master_state = REQUEST_ACTIVE,
-               .dict = args->namespace,
+               .proto_dict = fr_dict_proto_dict(dict),
+               .local_dict = dict,
                .component = "<pre-core>",
                .flags = {
-                       .detachable = args->detachable
+                       .detachable = args && args->detachable,
                },
                .alloc_file = file,
                .alloc_line = line
@@ -306,7 +320,7 @@ static inline CC_HINT(always_inline) int request_init(char const *file, int line
                 *      the any uninitialised lists and
                 *      create them locally.
                 */
-               memcpy(&request->pair_list, &args->pair_list, sizeof(request->pair_list));
+               if (args) memcpy(&request->pair_list, &args->pair_list, sizeof(request->pair_list));
 
 #define list_init(_ctx, _list) \
        do { \
@@ -337,7 +351,7 @@ static inline CC_HINT(always_inline) int request_init(char const *file, int line
         *      fields if this is going to be a
         *      child request.
         */
-       if (args->parent) {
+       if (args && args->parent) {
                if (request_child_init(request, args->parent) < 0) return -1;
 
                if (args->detachable) {
@@ -504,8 +518,6 @@ request_t *_request_alloc(char const *file, int line, TALLOC_CTX *ctx,
        request_t               *request;
        fr_dlist_head_t         *free_list;
 
-       if (!args) args = &default_args;
-
        /*
         *      Setup the free list, or return the free
         *      list for this thread.
@@ -610,8 +622,6 @@ request_t *_request_local_alloc(char const *file, int line, TALLOC_CTX *ctx,
 {
        request_t *request;
 
-       if (!args) args = &default_args;
-
        request = request_alloc_pool(ctx);
        if (request_init(file, line, request, type, args) < 0) return NULL;
 
@@ -814,6 +824,9 @@ void request_verify(char const *file, int line, request_t const *request)
        fr_pair_list_verify(file, line, request->session_state_ctx, &request->session_state_pairs);
        fr_pair_list_verify(file, line, request->local_ctx, &request->local_pairs);
 
+       fr_assert(request->proto_dict != NULL);
+       fr_assert(request->local_dict != NULL);
+
        if (request->packet) {
                packet_verify(file, line, request, request->packet, &request->request_pairs, "request");
        }
index 1b2934f4a4f6cc23f49072ece970c597a3495827..e628da9a8b201bff110dedb721296a25276c8e17 100644 (file)
@@ -183,7 +183,8 @@ struct request_s {
 
        uint64_t                seq_start;      //!< State sequence ID.  Stable identifier for a sequence of requests
                                                //!< and responses.
-       fr_dict_t const         *dict;          //!< Dictionary of the protocol that this request belongs to.
+       fr_dict_t const         *proto_dict;    //!< Dictionary of the protocol that this request belongs to.
+       fr_dict_t const         *local_dict;    //!< dictionary for local variables
 
        fr_pair_t               *pair_root;     //!< Root attribute which contains the
                                                ///< other list attributes as children.
index 3af9b6f487ce06250c241b13f02beeed69a2299e..6571a42102168f5e9829ac2155d43cc0248ff5c8 100644 (file)
@@ -41,7 +41,7 @@ static request_t *request_fake_alloc(void)
        /*
         *      Create and initialize the new request.
         */
-       request = request_local_alloc_external(autofree, NULL);
+       request = request_local_alloc_external(autofree, (&(request_init_args_t){ .namespace = test_dict }));
 
        request->packet = fr_packet_alloc(request, false);
        TEST_CHECK(request->packet != NULL);
index c8ce80e625ac235fe005e8bd2bc838cc01d30da7..26925d4511cb1d05348ddcfc18991b8744bc0800 100644 (file)
@@ -92,8 +92,7 @@ xlat_action_t trigger_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
        head = request_data_reference(request, &trigger_exec_main, REQUEST_INDEX_TRIGGER_ARGS);
 
-       da = fr_dict_attr_by_name(NULL, fr_dict_root(request->dict ? request->dict : fr_dict_internal()),
-                                 in_head->vb_strvalue);
+       da = fr_dict_attr_by_name(NULL, fr_dict_root(request->local_dict), in_head->vb_strvalue);
        if (!da) {
                ERROR("Unknown attribute \"%pV\"", in_head);
                return XLAT_ACTION_FAIL;
@@ -386,7 +385,7 @@ int trigger_exec(unlang_interpret_t *intp,
                                  &FR_SBUFF_IN(trigger->command, talloc_array_length(trigger->command) - 1),
                                  NULL, NULL, &(tmpl_rules_t) {
                                          .attr = {
-                                                 .dict_def = request->dict,
+                                                 .dict_def = request->local_dict,
                                                  .list_def = request_attr_request,
                                                  .allow_unresolved = false,
                                          },
index a129c23a50a4ff5f041d2f8a53e8cc30d7e24af4..96caa9928772358a7d4c53c518b9ae308b966160 100644 (file)
@@ -261,7 +261,7 @@ static int tls_cache_app_data_get(request_t *request, SSL_SESSION *sess)
         */
        while (fr_dbuff_remaining(&dbuff) > 0) {
                if (fr_internal_decode_pair_dbuff(request->session_state_ctx, &tmp,
-                                                 fr_dict_root(request->dict), &dbuff, NULL) < 0) {
+                                                 fr_dict_root(request->proto_dict), &dbuff, NULL) < 0) {
                        SESSION_ID(sess_id, sess);
 
                        fr_pair_list_free(&tmp);
index d9b3394996f080906142045c97e9db864f90bdb4..ab049242057eb4228a1c81b0298b28baf22b3b4b 100644 (file)
@@ -40,7 +40,7 @@ static unlang_action_t unlang_caller(rlm_rcode_t *p_result, request_t *request,
        /*
         *      No parent, or the dictionaries don't match.  Ignore it.
         */
-       if (!request->parent || (request->parent->dict != gext->dict)) {
+       if (!request->parent || (request->parent->proto_dict != gext->dict)) {
                RDEBUG2("...");
                return UNLANG_ACTION_EXECUTE_NEXT;
        }
index 4bb99e6ffde90c3aa6bb1f7a458e4187e96a3197..2604704b0193d2b03c1a2c8f2ce44115dfdad091 100644 (file)
@@ -4076,10 +4076,19 @@ static unlang_t *compile_subrequest(unlang_t *parent, unlang_compile_t *unlang_c
        dict = unlang_ctx->rules->attr.dict_def;
        packet_name = NULL;
 
+get_packet_type:
+       /*
+        *      Local attributes cannot be used in a subrequest.  They belong to the parent.  Local attributes
+        *      are NOT copied to the subrequest.
+        *
+        *      @todo - maybe we want to copy local variables, too?  But there may be multiple nested local
+        *      variables, each with their own dictionary.
+        */
+       dict = fr_dict_proto_dict(dict);
+
        /*
         *      Use dict name instead of "namespace", because "namespace" can be omitted.
         */
-get_packet_type:
        da = fr_dict_attr_by_name(NULL, fr_dict_root(dict), "Packet-Type");
        if (!da) {
                cf_log_err(cs, "No such attribute 'Packet-Type' in namespace '%s'", fr_dict_root(dict)->name);
index 9e15bd8a53dda8c79abd1c314119507ed68c2757..f6260ac28cbe2804e66bbf45c72fc635f2db4515 100644 (file)
@@ -129,7 +129,7 @@ static int tmpl_attr_from_result(TALLOC_CTX *ctx, map_t const *map, edit_result_
        slen = tmpl_afrom_attr_str(ctx, NULL, &out->to_free, box->vb_strvalue,
                                   &(tmpl_rules_t){
                                        .attr = {
-                                               .dict_def = request->dict,
+                                               .dict_def = request->local_dict,
                                                .list_def = request_attr_request,
                                        }
                                   });
@@ -328,7 +328,7 @@ static int apply_edits_to_list(request_t *request, unlang_frame_state_edit_t *st
                 *      point.  The ones which aren't moved will get deleted in this function.
                 */
                da = tmpl_attr_tail_da(current->lhs.vpt);
-               if (fr_type_is_group(da->type)) da = fr_dict_root(request->dict);
+               if (fr_type_is_group(da->type)) da = fr_dict_root(request->proto_dict);
 
                root = (fr_pair_parse_t) {
                        .ctx = current->ctx,
index c3a98af7297be5bc4d315ea55264c53955ae6fc0..8e6cd1cb0cee927d3bf27edf65a51a970f3a1ce5 100644 (file)
@@ -213,8 +213,8 @@ int unlang_interpret_push(request_t *request, unlang_t const *instruction,
 }
 
 typedef struct {
-       fr_dict_t const *dict;
-       request_t       *request;
+       fr_dict_t const *old_dict;      //!< the previous dictionary for the request
+       request_t       *request;       //!< the request
 } unlang_variable_ref_t;
 
 static int _local_variables_free(unlang_variable_ref_t *ref)
@@ -228,7 +228,7 @@ static int _local_variables_free(unlang_variable_ref_t *ref)
        vp = fr_pair_list_tail(&ref->request->local_pairs);
        while (vp) {
                prev = fr_pair_list_prev(&ref->request->local_pairs, vp);
-               if (vp->da->dict != ref->dict) {
+               if (vp->da->dict != ref->request->local_dict) {
                        break;
                }
 
@@ -236,6 +236,8 @@ static int _local_variables_free(unlang_variable_ref_t *ref)
                vp = prev;
        }
 
+       ref->request->local_dict = ref->old_dict;
+
        return 0;
 }
 
@@ -295,8 +297,9 @@ unlang_action_t unlang_interpret_push_children(rlm_rcode_t *p_result, request_t
        /*
         *      Set the destructor to clean up local variables.
         */
-       ref->dict = g->variables->dict;
        ref->request = request;
+       ref->old_dict = request->local_dict;
+       request->local_dict = g->variables->dict;
        talloc_set_destructor(ref, _local_variables_free);
 
        return UNLANG_ACTION_PUSHED_CHILD;
index ca1fdd5f672ff4d68a7b2483e53367211a79d1ea..c2d761fa75e4d94e7b1bc59bccc43c2ef21bd110 100644 (file)
@@ -40,6 +40,11 @@ request_t *unlang_io_subrequest_alloc(request_t *parent, fr_dict_t const *namesp
 {
        request_t               *child;
 
+       /*
+        *      A child cannot refer to local variables in the parent context.
+        */
+       fr_assert(fr_dict_proto_dict(namespace) == namespace);
+
        child = request_alloc_internal(detachable ? NULL : parent,
                                       (&(request_init_args_t){
                                                .parent = parent,
index f3ec4650a1b416fee4686f8e66c35f41b26b1727..22c2c0cc8da49af2350007354d77393a11e82599 100644 (file)
@@ -275,7 +275,7 @@ static unlang_action_t unlang_parallel_process(rlm_rcode_t *p_result, request_t
        for (i = 0; i < state->num_children; i++) {
                fr_assert(state->children[i].instruction != NULL);
                child = unlang_io_subrequest_alloc(request,
-                                                  request->dict, state->detach);
+                                                  request->proto_dict, state->detach);
                child->packet->code = request->packet->code;
 
                RDEBUG3("parallel - child %s (%d/%d) INIT",
index 00d9bd5973f62494af0419997c305f333cf8236b..87121458f254b26ff8bb65d280f46c1f2edf8b4c 100644 (file)
@@ -284,7 +284,7 @@ static xlat_action_t xlat_func_debug_attr(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcur
        if (tmpl_afrom_attr_str(request, NULL, &vpt, fmt,
                                &(tmpl_rules_t){
                                        .attr = {
-                                               .dict_def = request->dict,
+                                               .dict_def = request->local_dict,
                                                .list_def = request_attr_request,
                                                .allow_wildcard = true,
                                        }
@@ -933,7 +933,7 @@ static xlat_action_t xlat_func_immutable_attr(UNUSED TALLOC_CTX *ctx, UNUSED fr_
        if (tmpl_afrom_attr_str(request, NULL, &vpt, fmt,
                                &(tmpl_rules_t){
                                        .attr = {
-                                               .dict_def = request->dict,
+                                               .dict_def = request->local_dict,
                                                .list_def = request_attr_request,
                                                .allow_wildcard = true,
                                        }
@@ -1294,7 +1294,7 @@ static xlat_action_t xlat_func_map(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
        tmpl_rules_t    attr_rules = {
                .attr = {
-                       .dict_def = request->dict,
+                       .dict_def = request->local_dict,
                        .list_def = request_attr_request,
                },
                .xlat = {
@@ -1463,19 +1463,6 @@ static xlat_action_t xlat_eval_resume(UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_
        return xa;
 }
 
-typedef struct {
-       fr_dict_t const *namespace;     //!< Namespace we use for evaluating runtime expansions
-} xlat_eval_inst_t;
-
-static int xlat_eval_instantiate(xlat_inst_ctx_t const *xctx)
-{
-       xlat_eval_inst_t *inst = talloc_get_type_abort(xctx->inst, xlat_eval_inst_t);
-
-       inst->namespace = xctx->ex->call.dict;
-
-       return 0;
-}
-
 static xlat_arg_parser_t const xlat_func_eval_arg[] = {
        { .required = true, .concat = true, .type = FR_TYPE_STRING },
        XLAT_ARG_PARSER_TERMINATOR
@@ -1486,11 +1473,9 @@ static xlat_arg_parser_t const xlat_func_eval_arg[] = {
  * @ingroup xlat_functions
  */
 static xlat_action_t xlat_func_eval(TALLOC_CTX *ctx, fr_dcursor_t *out,
-                                   xlat_ctx_t const *xctx,
+                                   UNUSED xlat_ctx_t const *xctx,
                                    request_t *request, fr_value_box_list_t *args)
 {
-       xlat_eval_inst_t const *inst = talloc_get_type_abort_const(xctx->inst, xlat_eval_inst_t);
-
        /*
         *      These are escaping rules applied to the
         *      input string. They're mostly here to
@@ -1528,7 +1513,7 @@ static xlat_action_t xlat_func_eval(TALLOC_CTX *ctx, fr_dcursor_t *out,
                          },
                          &(tmpl_rules_t){
                                  .attr = {
-                                         .dict_def = inst->namespace,
+                                         .dict_def = request->local_dict,
                                          .list_def = request_attr_request,
                                          .allow_unknown = false,
                                          .allow_unresolved = false,
@@ -2443,7 +2428,7 @@ static xlat_action_t xlat_func_pairs(TALLOC_CTX *ctx, fr_dcursor_t *out,
        if (tmpl_afrom_attr_str(ctx, NULL, &vpt, in_head->vb_strvalue,
                                &(tmpl_rules_t){
                                        .attr = {
-                                               .dict_def = request->dict,
+                                               .dict_def = request->local_dict,
                                                .list_def = request_attr_request,
                                                .allow_wildcard = true,
                                        }
@@ -3912,7 +3897,7 @@ static xlat_action_t protocol_decode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
        fr_test_point_pair_decode_t const       *tp_decode = *(void * const *)xctx->inst;
 
        if (tp_decode->test_ctx) {
-               if (tp_decode->test_ctx(&decode_ctx, ctx, request->dict) < 0) {
+               if (tp_decode->test_ctx(&decode_ctx, ctx, request->proto_dict) < 0) {
                        return XLAT_ACTION_FAIL;
                }
        }
@@ -4033,7 +4018,7 @@ static xlat_action_t protocol_encode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
        if (tmpl_afrom_attr_str(ctx, NULL, &vpt, in_head->vb_strvalue,
                                &(tmpl_rules_t){
                                        .attr = {
-                                               .dict_def = request->dict,
+                                               .dict_def = request->proto_dict, /* we can't encode local attributes */
                                                .list_def = request_attr_request,
                                                .allow_wildcard = true,
                                        }
@@ -4046,7 +4031,7 @@ static xlat_action_t protocol_encode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
         *      Create the encoding context.
         */
        if (tp_encode->test_ctx) {
-               if (tp_encode->test_ctx(&encode_ctx, vpt, request->dict) < 0) {
+               if (tp_encode->test_ctx(&encode_ctx, vpt, request->proto_dict) < 0) {
                        talloc_free(vpt);
                        return XLAT_ACTION_FAIL;
                }
@@ -4062,7 +4047,7 @@ static xlat_action_t protocol_encode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
 
                /*
                 *      Don't check the dictionaries.  By definition,
-                *      vp->da->dict==request->dict, OR else we're
+                *      vp->da->dict==request->proto_dict, OR else we're
                 *      using the internal encoder and encoding a real
                 *      protocol.
                 *
@@ -4397,7 +4382,6 @@ do { \
        XLAT_REGISTER_PURE("urlquote", xlat_func_urlquote, FR_TYPE_STRING, xlat_func_urlquote_arg);
        XLAT_REGISTER_PURE("urlunquote", xlat_func_urlunquote, FR_TYPE_STRING, xlat_func_urlunquote_arg);
        XLAT_REGISTER_PURE("eval", xlat_func_eval, FR_TYPE_VOID, xlat_func_eval_arg);
-       xlat_func_instantiate_set(xlat, xlat_eval_instantiate, xlat_eval_inst_t, NULL, NULL);
 
        return xlat_register_expressions();
 }
index f991fad364f637c49f5cc6f47f4c1d2912d97bf9..c6b99c20172897bd517d82ddbe5a495a26acd722 100644 (file)
@@ -1658,7 +1658,7 @@ ssize_t _xlat_eval(TALLOC_CTX *ctx, char **out, size_t outlen, request_t *reques
                            NULL,
                            &(tmpl_rules_t){
                                    .attr = {
-                                           .dict_def = request->dict,
+                                           .dict_def = request->local_dict,
                                            .list_def = request_attr_request,
                                    },
                                    .xlat = {
index 35ef2f520c49d976519f4234374088a6adfc6816..e3fd6c6b9d9ce90cff6f0a4428b74a8737fc4f58 100644 (file)
@@ -93,7 +93,7 @@ int xlat_decode_value_box_list(TALLOC_CTX *ctx, fr_pair_list_t *out,
 {
        int             decoded = 0;
        fr_pair_t       *vp = NULL;
-       fr_dict_attr_t const *parent = fr_dict_root(request->dict);
+       fr_dict_attr_t const *parent = fr_dict_root(request->proto_dict);
        fr_pair_list_t  head;
 
        fr_pair_list_init(&head);
index a21c262b73cfcd16cbfb1f187e331b6cc2797226..4ab494da95913178fc08c01ea462517ea51f27c4 100644 (file)
@@ -231,21 +231,7 @@ static int xlat_purify_list_internal(xlat_exp_head_t *head, request_t *request,
                         */
                        if (!node->flags.pure) {
                                if (node->call.func->purify) {
-                                       fr_dict_t const *dict = request->dict;
-
-                                       /*
-                                        *      Swap in the node specific dictionary.
-                                        *
-                                        *      The previous code stored the dictionary in the xlat_exp_head_t,
-                                        *      and whilst this wasn't wrong, it was duplicative.
-                                        *
-                                        *      This allows future code to create inline definitions of local
-                                        *      attributes, and have them work correctly, as more deeply nested
-                                        *      expressions would swap in the correct dictionary.
-                                        */
-                                       request->dict = node->call.dict;
                                        if (node->call.func->purify(node, node->call.inst->data, request) < 0) return -1;
-                                       request->dict = dict;
                                } else {
                                        if (xlat_purify_list_internal(node->call.args, request, T_BARE_WORD) < 0) return -1;
                                }
@@ -321,7 +307,7 @@ int xlat_purify(xlat_exp_head_t *head, unlang_interpret_t *intp)
 
        if (!head->flags.can_purify) return 0;
 
-       request = request_alloc_internal(NULL, (&(request_init_args_t){ .namespace = fr_dict_internal() }));
+       request = request_alloc_internal(NULL, NULL);
        if (!request) return -1;
 
        if (intp) unlang_interpret_set(request, intp);
index e3885cec9995265d3d86e4a9fcdabaf8a1daa018..e523405a3a2cfb207a4413ba0e7cb8b72f46b643 100644 (file)
@@ -748,6 +748,8 @@ fr_dict_t const             *fr_dict_by_protocol_num(unsigned int num);
 
 fr_dict_attr_t const   *fr_dict_unlocal(fr_dict_attr_t const *da) CC_HINT(nonnull);
 
+fr_dict_t const                *fr_dict_proto_dict(fr_dict_t const *dict) CC_HINT(nonnull);
+
 fr_dict_t const                *fr_dict_by_da(fr_dict_attr_t const *da) CC_HINT(nonnull);
 
 fr_dict_t const                *fr_dict_by_attr_name(fr_dict_attr_t const **found, char const *name);
index 06e59c30594ba21fc6001d6a8fcf8f5119a23799..403378346e88eb1074941988647068dc31d40318 100644 (file)
@@ -4958,7 +4958,7 @@ fr_dict_protocol_t const *fr_dict_protocol(fr_dict_t const *dict)
 }
 
 /*
- *     Get the real protocol dictionary behind the local one.
+ *     Get the real protocol namespace behind a local one.
  */
 fr_dict_attr_t const *fr_dict_unlocal(fr_dict_attr_t const *da)
 {
@@ -4973,6 +4973,16 @@ fr_dict_attr_t const *fr_dict_unlocal(fr_dict_attr_t const *da)
        return da;
 }
 
+/*
+ *     Get the real protocol dictionary behind a local one.
+ */
+fr_dict_t const        *fr_dict_proto_dict(fr_dict_t const *dict)
+{
+       while (dict->next) dict = dict->next;
+
+       return dict;
+}
+
 int fr_dict_attr_set_group(fr_dict_attr_t **da_p)
 {
        if ((*da_p)->type == FR_TYPE_GROUP) {
index 714962d09bfaa9026ded2101fef0c2f7dc817d1c..e753063b1b48b3001fcd961811a62de7e00d8fff 100644 (file)
@@ -67,13 +67,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
 //     proto_arp_t const       *inst = talloc_get_type_abort_const(instance, proto_arp_t);
        fr_arp_packet_t const   *arp;
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = dict_arp;
-
        if (fr_arp_decode(request->request_ctx, &request->request_pairs, data, data_len) < 0) {
                RPEDEBUG("Failed decoding packet");
                return -1;
index 6444f2974879ee6c591150c8aa9c944d3d441f0b..ed276a6abdc476b371290bca56f521cdc547173f 100644 (file)
@@ -150,13 +150,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
        bfd_wrapper_t const     *wrapper = (bfd_wrapper_t const *) data;
        bfd_packet_t const      *bfd = (bfd_packet_t const *) wrapper->packet;
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = dict_bfd;
-
        client = address->radclient;
 
        /*
index 5b1561ca7537bc8b2e95c36ab723c2d7d5f5e9d8..628a206101023c105c0202753dee6fb0ecbc62f5 100644 (file)
@@ -129,7 +129,6 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d
 {
        proto_cron_t const      *inst = talloc_get_type_abort_const(instance, proto_cron_t);
 
-       request->dict = inst->dict;
        request->packet->code = inst->code;
 
        /*
index 6f91ce88ddb9c3ef18d8a8c2a467c50ea929ce7d..d3a0eb8f0c6d3f417cb45b138708e620501111bf 100644 (file)
@@ -434,13 +434,6 @@ static int mod_decode(void const *instance, request_t *request, UNUSED uint8_t *
        fr_io_track_t const     *track = talloc_get_type_abort_const(request->async->packet_ctx, fr_io_track_t);
        fr_io_address_t const   *address = track->address;
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = inst->dict;
-
        /*
         *      Hacks for now until we have a lower-level decode routine.
         */
index 20e537c678922e935c0282347211e73d2b094d02..c30487d80787757cc8865fd2b65e6fa481432ae2 100644 (file)
@@ -90,7 +90,6 @@ static fr_dict_attr_t const *attr_packet_dst_port;
 static fr_dict_attr_t const *attr_packet_original_timestamp;
 static fr_dict_attr_t const *attr_packet_src_ip_address;
 static fr_dict_attr_t const *attr_packet_src_port;
-static fr_dict_attr_t const *attr_protocol;
 
 extern fr_dict_attr_autoload_t proto_detail_dict_attr[];
 fr_dict_attr_autoload_t proto_detail_dict_attr[] = {
@@ -99,7 +98,6 @@ fr_dict_attr_autoload_t proto_detail_dict_attr[] = {
        { .out = &attr_packet_original_timestamp, .name = "Packet-Original-Timestamp", .type = FR_TYPE_DATE, .dict = &dict_freeradius },
        { .out = &attr_packet_src_ip_address, .name = "Net.Src.IP", .type = FR_TYPE_COMBO_IP_ADDR, .dict = &dict_freeradius },
        { .out = &attr_packet_src_port, .name = "Net.Src.Port", .type = FR_TYPE_UINT16, .dict = &dict_freeradius },
-       { .out = &attr_protocol, .name = "Protocol", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
 
        { NULL }
 };
@@ -227,7 +225,6 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d
 
        RHEXDUMP3(data, data_len, "proto_detail decode packet");
 
-       request->dict = inst->dict;
        request->packet->code = inst->code;
 
        /*
@@ -280,7 +277,6 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d
                 */
                if ((*p != '\0') && (*p != '\t')) {
                        REDEBUG("Malformed line %d", lineno);
-               error:
                        fr_dcursor_free_list(&cursor);
                        return -1;
                }
@@ -355,7 +351,7 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d
                 */
                root = (fr_pair_parse_t) {
                        .ctx = request->request_ctx,
-                       .da = fr_dict_root(request->dict),
+                       .da = fr_dict_root(request->proto_dict),
                        .list = &tmp_list,
                };
                relative = (fr_pair_parse_t) { };
@@ -381,12 +377,6 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d
                                request->packet->socket.inet.src_port = vp->vp_uint16;
                        } else if (vp->da == attr_packet_dst_port) {
                                request->packet->socket.inet.dst_port = vp->vp_uint16;
-                       } else if (vp->da == attr_protocol) {
-                               request->dict = fr_dict_by_protocol_num(vp->vp_uint32);
-                               if (!request->dict) {
-                                       REDEBUG("Invalid protocol: %pP", vp);
-                                       goto error;
-                               }
                        }
                }
 
index 90746d8af3487efe89b9db25fe008be5b1fe0e0b..981780daca4aeb1f47122d780b6627f435b21671 100644 (file)
@@ -170,13 +170,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
        fr_client_t const *client;
        fr_packet_t *packet = request->packet;
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = dict_dhcpv4;
-
        RHEXDUMP3(data, data_len, "proto_dhcpv4 decode packet");
 
        client = address->radclient;
index c42cb32546bb47f4ce264a2bc09f0904c3ab32cb..c24aa8e24741b745d8d7b2a78eb84e182abcf5bf 100644 (file)
@@ -170,13 +170,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
        fr_client_t const               *client;
        fr_packet_t     *packet = request->packet;
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = dict_dhcpv6;
-
        RHEXDUMP3(data, data_len, "proto_dhcpv6 decode packet");
 
        client = address->radclient;
index 0bf01224f19b847fbf674aba9962beeb156112fd..37a2e81bd5f7ed986cd31fc9da10da4bb276f06f 100644 (file)
@@ -145,13 +145,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
        fr_dns_packet_t const   *packet = (fr_dns_packet_t const *) data;
        fr_dns_ctx_t            packet_ctx;
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = dict_dns;
-
        RHEXDUMP3(data, data_len, "proto_dns decode packet");
 
        client = address->radclient;
index dfe9ae5938e3ec75f89dc1e4ebe56e4335cb89dc..68e24157df408e99de9807e0261c28dbf49b7738 100644 (file)
@@ -126,7 +126,7 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
        ssize_t                         ret;
        fr_pair_t                       *vp = NULL;
 
-       request->dict = dict_ldap_sync;
+       fr_assert(request->proto_dict == dict_ldap_sync);
 
        fr_dbuff_init(&dbuff, data, data_len);
 
@@ -134,7 +134,7 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
         *      Extract attributes from the passed data
         */
        ret = fr_internal_decode_list_dbuff(request->pair_list.request, &request->request_pairs,
-                                          fr_dict_root(request->dict), &dbuff, NULL);
+                                          fr_dict_root(request->proto_dict), &dbuff, NULL);
        if (ret < 0) return -1;
 
        vp = fr_pair_find_by_da(&request->request_pairs, NULL, attr_packet_type);
index 4e2849bfeacc1962994af28500748eeb1dfb536e..7c78e7fab4198169520a0f3b5753876a79190975 100644 (file)
@@ -129,7 +129,6 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d
 {
        proto_load_t const      *inst = talloc_get_type_abort_const(instance, proto_load_t);
 
-       request->dict = inst->dict;
        request->packet->code = inst->code;
 
        /*
index 4711034790774f73590896fdd6f2bae0c933f6f3..9fa0aa78f90516a715e94fb74d1e02a93eec791b 100644 (file)
@@ -259,13 +259,6 @@ static int mod_decode(void const *instance, request_t *request, UNUSED uint8_t *
        fr_io_track_t const     *track = talloc_get_type_abort_const(request->async->packet_ctx, fr_io_track_t);
        fr_io_address_t const   *address = track->address;
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = inst->dict;
-
        /*
         *      Hacks for now until we have a lower-level decode routine.
         */
index 129cc9359a77fa10b70fda1a4ea697ebaec2a57f..ee52328a3f967b9ebc0b2938ad48cc04203845fb 100644 (file)
@@ -205,13 +205,6 @@ static int mod_decode(void const *instance, request_t *request, uint8_t *const d
 
        fr_assert(data[0] < FR_RADIUS_CODE_MAX);
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = dict_radius;
-
        common_ctx = (fr_radius_ctx_t) {
                .secret = client->secret,
                .secret_length = talloc_array_length(client->secret) - 1,
@@ -679,7 +672,7 @@ static xlat_action_t packet_vector_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
 {
        fr_value_box_t  *vb;
 
-       if (request->dict != dict_radius) return XLAT_ACTION_FAIL;
+       if (request->proto_dict != dict_radius) return XLAT_ACTION_FAIL;
 
        MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_OCTETS, NULL));
        if (fr_value_box_memdup(vb, vb, NULL, request->packet->vector, sizeof(request->packet->vector), true) < 0) {
index 0d9a0852c4e068f8189bc1a34a56fd3d8ab3e841..af067ed4ff44fd54aee49b4b7665d23c3f368e3a 100644 (file)
@@ -161,13 +161,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
 
        RHEXDUMP3(data, data_len, "proto_tacacs decode packet");
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = dict_tacacs;
-
        client = address->radclient;
 
        /*
index 751b7447f68165a0b6562f88197187c71fdd5c90..5c149899b2d5ae53ba24d4a415fd625653851032 100644 (file)
@@ -152,13 +152,6 @@ static int mod_decode(UNUSED void const *instance, request_t *request, uint8_t *
 
        RHEXDUMP3(data, data_len, "proto_vmps decode packet");
 
-       /*
-        *      Set the request dictionary so that we can do
-        *      generic->protocol attribute conversions as
-        *      the request runs through the server.
-        */
-       request->dict = dict_vmps;
-
        client = address->radclient;
 
        /*
index ea2657f11817f6d23f16e5bf84596b76db7d71ac..52014aa5d13ea18b7e22a023a1ba31181d4933ec 100644 (file)
@@ -190,7 +190,7 @@ static cache_status_t cache_entry_find(rlm_cache_entry_t **out,
 
        MEM(c = talloc_zero(NULL, rlm_cache_entry_t));
        map_list_init(&c->maps);
-       ret = cache_deserialize(request, c, request->dict, from_store, len);
+       ret = cache_deserialize(request, c, request->proto_dict, from_store, len);
        free(from_store);
        if (ret < 0) {
                RPERROR("Invalid entry");
index 9a86ef6b4ae63722d70b91c760fb95d6ca1f1711..335a06c0ea03e68e74bc5efa5517a8dcd8c3bb65 100644 (file)
@@ -908,7 +908,7 @@ xlat_action_t cache_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                                      NULL,
                                      &(tmpl_rules_t){
                                        .attr = {
-                                               .dict_def = request->dict,
+                                               .dict_def = request->proto_dict,
                                                .list_def = request_attr_request,
                                        }
                                      });
index f2279a0b3ff8c8ab94f61a76a870d676d81ccbd7..44c8058856fefbf90d9bc477f0e5fd1b70c5b442 100644 (file)
@@ -69,7 +69,7 @@ static int _map_proc_client_get_vp(TALLOC_CTX *ctx, fr_pair_list_t *out, request
                        return -1;
                }
 
-               da = fr_dict_attr_by_name(NULL, fr_dict_root(request->dict), attr);
+               da = fr_dict_attr_by_name(NULL, fr_dict_root(request->local_dict), attr);
                if (!da) {
                        RWDEBUG("No such attribute '%s'", attr);
                        talloc_free(attr);
index 8db4253365ca6f9c0a2768b8f4ab93ba34603a58..aa97808a62f02a41f6ac007ffc05d1f86b4cbeed 100644 (file)
@@ -857,7 +857,7 @@ static int csv_map_getvalue(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *req
                }
 
 
-               da = fr_dict_attr_by_name(NULL, fr_dict_root(request->dict), attr);
+               da = fr_dict_attr_by_name(NULL, fr_dict_root(request->local_dict), attr);
                if (!da) {
                        RWDEBUG("No such attribute '%s'", attr);
                        talloc_free(attr);
index 6edb366690f0a477bc8008e1315508d5b56ba6c7..7837207b4bf6410ae4992f2daaab2c30e0f01797 100644 (file)
@@ -52,7 +52,7 @@ static int xlat_fmt_get_vp(fr_pair_t **out, request_t *request, char const *name
        if (tmpl_afrom_attr_str(request, NULL, &vpt, name,
                                &(tmpl_rules_t){
                                        .attr = {
-                                               .dict_def = request->dict,
+                                               .dict_def = request->proto_dict,
                                                .list_def = request_attr_request,
                                        }
                                }) <= 0) return -4;
@@ -81,7 +81,7 @@ static xlat_action_t xlat_dict_attr_by_num(TALLOC_CTX *ctx, fr_dcursor_t *out,
        fr_value_box_t          *attr = fr_value_box_list_head(in);
        fr_value_box_t          *vb;
 
-       da = fr_dict_attr_child_by_num(fr_dict_root(request->dict), attr->vb_uint32);
+       da = fr_dict_attr_child_by_num(fr_dict_root(request->proto_dict), attr->vb_uint32);
        if (!da) {
                REDEBUG("No attribute found with number %pV", attr);
                return XLAT_ACTION_FAIL;
@@ -112,7 +112,7 @@ static xlat_action_t xlat_dict_attr_by_oid(TALLOC_CTX *ctx, fr_dcursor_t *out,
                                           request_t *request, fr_value_box_list_t *in)
 {
        unsigned int            attr = 0;
-       fr_dict_attr_t const    *parent = fr_dict_root(request->dict);
+       fr_dict_attr_t const    *parent = fr_dict_root(request->proto_dict);
        fr_dict_attr_t const    *da;
        ssize_t                 ret;
        fr_value_box_t          *attr_vb = fr_value_box_list_head(in);
index 05233068c489d2c6a027e866ea7c8f7ee8c30361..696b97a5c744c1cfd7e50d1b2d0096311039e5e9 100644 (file)
@@ -795,7 +795,7 @@ static unlang_action_t eap_method_select(rlm_rcode_t *p_result, module_ctx_t con
        MEM(eap_session->subrequest = unlang_subrequest_alloc(request,
                                                              method->submodule->namespace ?
                                                              *(method->submodule->namespace) :
-                                                             request->dict));
+                                                             request->proto_dict));
 
        if (method->submodule->clone_parent_lists) {
                if (fr_pair_list_copy(eap_session->subrequest->control_ctx,
index e91e6639336f24058cbd2afc578ea47f4a495c74..07405f9cf8465f7a84cdcecd3a677ddd5d2529d9 100644 (file)
@@ -498,7 +498,7 @@ unlang_action_t eap_peap_process(rlm_rcode_t *p_result, request_t *request,
                        goto finish;
        }
 
-       MEM(child = unlang_subrequest_alloc(request, request->dict));
+       MEM(child = unlang_subrequest_alloc(request, request->proto_dict));
        fr_assert(fr_pair_list_empty(&child->request_pairs));
 
        switch (t->status) {
index e829f062d36df6dea07fcddb1d00d14cd06278d3..c39c5c4c202fb323b32c2d3f0c179d24239f6d3f 100644 (file)
@@ -300,7 +300,7 @@ static unlang_action_t mod_exec_oneshot_wait_resume(rlm_rcode_t *p_result, modul
                        fr_sbuff_t      in = FR_SBUFF_IN(box->vb_strvalue, box->vb_length);
                        tmpl_rules_t    lhs_rules = (tmpl_rules_t) {
                                .attr = {
-                                       .dict_def = request->dict,
+                                       .dict_def = request->local_dict,
                                        .list_def = tmpl_list(inst->output_list),
                                        .list_presence = TMPL_ATTR_LIST_ALLOW,
 
index e99873e68d9045283cba1f2112959246588e2eb3..bd324f98c86e0d18eca55b18509f78a86e1d2abb 100644 (file)
@@ -243,7 +243,7 @@ static xlat_action_t json_encode_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                                                .attr = {
                                                        .list_def = request_attr_request,
                                                        .allow_wildcard = true,
-                                                       .dict_def = request->dict,
+                                                       .dict_def = request->proto_dict,
                                                }
                                              });
                if (slen <= 0) {
index 5834934e47e23325d1def6f72e388082969005b4..05a012c776d331f34cc859bffe11405b0992c861 100644 (file)
@@ -815,7 +815,7 @@ unlang_action_t rlm_ldap_check_groupobj_dynamic(rlm_rcode_t *p_result, request_t
 
                t_rules = (tmpl_rules_t){
                        .attr = {
-                               .dict_def = request->dict,
+                               .dict_def = request->proto_dict,
                                .list_def = request_attr_request,
                        },
                        .xlat = {
index 7ae822c98bcfcb6020f5b616a7f6c8757ed69308..ed1b03879fd552ab7f573f34efdad22ea5123edc 100644 (file)
@@ -123,7 +123,7 @@ static unlang_action_t ldap_map_profile_resume(UNUSED rlm_rcode_t *p_result, UNU
 
                        tmpl_rules_t const parse_rules = {
                                .attr = {
-                                       .dict_def = request->dict,
+                                       .dict_def = request->proto_dict,
                                        .list_def = request_attr_request,
                                },
                                .xlat = {
index 3de1f3cfa828e24d1906e645e9d736e5f6196b4b..6638df15e08f7d97f11fd2a8059b4434fdf64216 100644 (file)
@@ -765,7 +765,7 @@ static unlang_action_t CC_HINT(nonnull) mod_do_linelog(rlm_rcode_t *p_result, mo
                                         &(tmpl_rules_t){
                                                .attr = {
                                                        .list_def = request_attr_request,
-                                                       .dict_def = request->dict,
+                                                       .dict_def = request->local_dict,
                                                        .allow_unknown = true,
                                                        .allow_unresolved = false,
                                                },
index 40c93863c0c8d0913633f4b1d04ab1f3a1c0881d..2a31c1a7550f0f47ae0cdfb1d808aa8055d7576a 100644 (file)
@@ -544,7 +544,7 @@ static int _lua_pair_accessor_init(lua_State *L)
                return -1;
        }
 
-       da = fr_dict_attr_by_name(NULL, fr_dict_root(request->dict), attr);
+       da = fr_dict_attr_by_name(NULL, fr_dict_root(request->proto_dict), attr);
        if (!da) {
                REDEBUG("Unknown or invalid attribute name \"%s\"", attr);
                return -1;
index d9b81ff1519d5dfff082e26b87b3460af8ed4da6..10c806645c3615e5e754bb83fcd11c8cbaa66ca6 100644 (file)
@@ -361,7 +361,7 @@ static void add_vp_tuple(TALLOC_CTX *ctx, request_t *request, fr_pair_list_t *vp
                if (tmpl_afrom_attr_str(request, NULL, &dst, ckey,
                                        &(tmpl_rules_t){
                                                .attr = {
-                                                       .dict_def = request->dict,
+                                                       .dict_def = request->proto_dict,
                                                        .list_def = request_attr_reply,
                                                }
                                        }) <= 0) {
index 727587dc4ad1b7d5750e8c5d2ebacf1e8fdbce16..cd23bc2975fe78147e7517dfc015fa55612d7f91 100644 (file)
@@ -521,7 +521,7 @@ static void result_add(TALLOC_CTX *ctx, rlm_passwd_t const *inst, request_t *req
                if (inst->pwd_fmt->field[i] && *inst->pwd_fmt->field[i] && pw->field[i] &&
                    (i != inst->key_field) && inst->pwd_fmt->listflag[i] == when) {
                        if (!inst->ignore_empty || pw->field[i][0] != 0 ) { /* if value in key/value pair is not empty */
-                               fr_dict_attr_t const *da = fr_dict_attr_by_name(NULL, fr_dict_root(request->dict), inst->pwd_fmt->field[i]);
+                               fr_dict_attr_t const *da = fr_dict_attr_by_name(NULL, fr_dict_root(request->proto_dict), inst->pwd_fmt->field[i]);
                                size_t len;
 
                                if (!da) {
index 376354d83c641a8e972de243b8460fb991d95f7e..eb7e4e16d1cf4b90010456fc149e97f33909957b 100644 (file)
@@ -914,28 +914,28 @@ static unlang_action_t do_perl(rlm_rcode_t *p_result, module_ctx_t const *mctx,
                fr_pair_list_init(&vps);
                if (inst->replace.request &&
                    (get_hv_content(request->request_ctx, request, rad_request_hv, &vps, "request",
-                                   fr_dict_root(request->dict), true)) > 0) {
+                                   fr_dict_root(request->proto_dict), true)) > 0) {
                        fr_pair_list_free(&request->request_pairs);
                        fr_pair_list_append(&request->request_pairs, &vps);
                }
 
                if (inst->replace.reply &&
                    (get_hv_content(request->reply_ctx, request, rad_reply_hv, &vps, "reply",
-                                   fr_dict_root(request->dict), true)) > 0) {
+                                   fr_dict_root(request->proto_dict), true)) > 0) {
                        fr_pair_list_free(&request->reply_pairs);
                        fr_pair_list_append(&request->reply_pairs, &vps);
                }
 
                if (inst->replace.control &&
                    (get_hv_content(request->control_ctx, request, rad_config_hv, &vps, "control",
-                                   fr_dict_root(request->dict), true)) > 0) {
+                                   fr_dict_root(request->proto_dict), true)) > 0) {
                        fr_pair_list_free(&request->control_pairs);
                        fr_pair_list_append(&request->control_pairs, &vps);
                }
 
                if (inst->replace.session &&
                    (get_hv_content(request->session_state_ctx, request, rad_state_hv, &vps, "session-state",
-                                   fr_dict_root(request->dict), true)) > 0) {
+                                   fr_dict_root(request->proto_dict), true)) > 0) {
                        fr_pair_list_free(&request->session_state_pairs);
                        fr_pair_list_append(&request->session_state_pairs, &vps);
                }
index 169eff683b56f08784120425f5280119243cfe48..e9ab8d27fa15a8cdbd5a2acb07fcf99cd6a9c493 100644 (file)
@@ -338,7 +338,7 @@ static void mod_vptuple(TALLOC_CTX *ctx, module_ctx_t const *mctx, request_t *re
                if (tmpl_afrom_attr_str(ctx, NULL, &dst, s1,
                                        &(tmpl_rules_t){
                                                .attr = {
-                                                       .dict_def = request->dict,
+                                                       .dict_def = request->proto_dict,
                                                        .list_def = request_attr_reply,
                                                }
                                        }) <= 0) {
index 57b7d6265377a9df4986501bc03d481fb6e1abb4..53cc19f4157b770956a2f8e5a2654c2ef52f2935 100644 (file)
@@ -250,7 +250,7 @@ static void CC_HINT(nonnull) status_check_alloc(bio_handle_t *h)
 
        fr_assert(!h->status_u && !h->status_request);
 
-       MEM(request = request_local_alloc_external(h, NULL));
+       MEM(request = request_local_alloc_external(h, (&(request_init_args_t){ .namespace = dict_radius })));
        MEM(u = talloc_zero(request, bio_request_t));
        talloc_set_destructor(u, _bio_request_free);
 
@@ -2343,7 +2343,7 @@ static int mod_enqueue(bio_request_t **p_u, fr_retry_config_t const **p_retry_co
                if (!request->parent) {
                        u->proxied = (request->client->cs != NULL);
 
-               } else if (!fr_dict_compatible(request->parent->dict, request->dict)) {
+               } else if (!fr_dict_compatible(request->parent->proto_dict, request->proto_dict)) {
                        u->proxied = false;
 
                } else {
index ec936891dfb0f216f0b5a8bd8110c11f94f12d65..0ae119dac46f3eddc39e1401132cde404ecac45c 100644 (file)
@@ -735,7 +735,7 @@ static int rest_decode_post(UNUSED rlm_rest_t const *instance, UNUSED rlm_rest_s
                if (tmpl_afrom_attr_str(request, NULL, &dst, name,
                                        &(tmpl_rules_t){
                                                .attr = {
-                                                       .dict_def = request->dict,
+                                                       .dict_def = request->proto_dict,
                                                        .list_def = request_attr_reply
                                                }
                                        }) <= 0) {
@@ -1025,7 +1025,7 @@ static int json_pair_alloc(rlm_rest_t const *instance, rlm_rest_section_t const
                        if (tmpl_afrom_attr_str(request, NULL, &dst, name,
                                                &(tmpl_rules_t){
                                                        .attr = {
-                                                               .dict_def = request->dict,
+                                                               .dict_def = request->proto_dict,
                                                                .list_def = request_attr_reply
                                                        }
                                                }) <= 0) {
index df5e4f53ad7e96d8624d41a67bce8cef3ad5ba55..575863a3824f3c88c2af299b400b0776a2fb3af8 100644 (file)
@@ -297,7 +297,7 @@ static unlang_action_t sql_get_map_list_resume(rlm_rcode_t *p_result, UNUSED int
        fr_sql_map_ctx_t        *map_ctx = talloc_get_type_abort(uctx, fr_sql_map_ctx_t);
        tmpl_rules_t            lhs_rules = (tmpl_rules_t) {
                .attr = {
-                       .dict_def = request->dict,
+                       .dict_def = request->local_dict,
                        .list_def = map_ctx->list,
                        .list_presence = TMPL_ATTR_LIST_ALLOW
                }
index 9ba0b55ce720712602a3765521ee5c8baf26e4d0..26ae2676a710a6d6cfa35c1010c1777a535797e6 100644 (file)
@@ -49,7 +49,7 @@ typedef struct {
 
 /*
  *     @todo - MULTI_PROTOCOL - make this protocol agnostic.
- *     Perhaps keep stats in a hash table by (request->dict, request->code) ?
+ *     Perhaps keep stats in a hash table by (request->proto_dict, request->code) ?
  */
 
 typedef struct {
@@ -173,7 +173,7 @@ static unlang_action_t CC_HINT(nonnull) mod_stats_inc(rlm_rcode_t *p_result, mod
        rlm_stats_data_t        *stats;
        rlm_stats_data_t        mydata;
 
-       if (request->dict != dict_radius) {
+       if (request->proto_dict != dict_radius) {
                RWARN("%s can only be called in RADIUS virtual servers", mctx->mi->name);
                RETURN_MODULE_NOOP;
        }
@@ -260,7 +260,7 @@ static unlang_action_t CC_HINT(nonnull) mod_stats_read(rlm_rcode_t *p_result, mo
        rlm_stats_data_t mydata;
        uint64_t local_stats[NUM_ELEMENTS(inst->mutable->stats)];
 
-       if (request->dict != dict_radius) {
+       if (request->proto_dict != dict_radius) {
                RWARN("%s can only be called in RADIUS virtual servers", mctx->mi->name);
                RETURN_MODULE_NOOP;
        }
index dcdcf76cb937a84b26e79312e881f97a4ca0f7cf..9de87aacb02257ec3ef6b85d35ea1c2036daf97f 100644 (file)
@@ -294,7 +294,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize(rlm_rcode_t *p_result, mod
                 *      Don't print out debugging messages if we know
                 *      they're useless.
                 */
-               if ((request->dict == dict_radius) && request->packet->code != FR_RADIUS_CODE_ACCESS_CHALLENGE) {
+               if ((request->proto_dict == dict_radius) && request->packet->code != FR_RADIUS_CODE_ACCESS_CHALLENGE) {
                        RDEBUG2("No cleartext password in the request. Can't do Yubikey authentication");
                }
 
index c2b8cabf9d1562138cd5a1b5f668746c2857100d..86103cbdc59dc798af14255b03a8f29c6e5727ca 100644 (file)
@@ -187,7 +187,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "arp";
        request->module = NULL;
-       fr_assert(request->dict == dict_arp);
+       fr_assert(request->proto_dict == dict_arp);
 
        UPDATE_STATE(packet);
 
index 1e63dbf0a51538de406cfde701fbcc1d640356ca..2c306d1a33a31e9f20e4f9ee11429bff61b5c790 100644 (file)
@@ -237,7 +237,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
        request->component = "bfd";
        request->module = NULL;
 
-       fr_assert(request->dict == dict_bfd);
+       fr_assert(request->proto_dict == dict_bfd);
 
        wrapper = (bfd_wrapper_t const *) request->packet->data;
 
index 104d1181c94ac0a171e4b14f6587df38c8ecd62b..7ea92aa278858b80da69b011ccc63c91c2512138 100644 (file)
@@ -400,7 +400,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "dhcpv4";
        request->module = NULL;
-       fr_assert(request->dict == dict_dhcpv4);
+       fr_assert(request->proto_dict == dict_dhcpv4);
 
        UPDATE_STATE(packet);
 
index f937cc678ed87d14da4e3aaf1cc5bd0d33c525b0..dfc4f7387c487dd83a8a635a581c57d4e4138e97 100644 (file)
@@ -527,7 +527,7 @@ void status_code_add(process_dhcpv6_t const *inst, request_t *request, fr_value_
         *      Move the module failure messages upwards
         *      if requested to by the user.
         */
-       if (inst->move_failure_message_to_parent && request->parent && (request->parent->dict == request->dict)) {
+       if (inst->move_failure_message_to_parent && request->parent && (request->parent->proto_dict == request->proto_dict)) {
                fr_pair_t const *prev = NULL;
 
                while ((failure_message = fr_pair_find_by_da(&request->request_pairs,
@@ -724,7 +724,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "dhcpv6";
        request->module = NULL;
-       fr_assert(request->dict == dict_dhcpv6);
+       fr_assert(request->proto_dict == dict_dhcpv6);
 
        UPDATE_STATE(packet);
 
index 95990c7207d888aacdc41dceb3c3ba4296c3d3c6..93f621eedb3ff9cb6d3c33ef713f92b2730801fb 100644 (file)
@@ -480,7 +480,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "dns";
        request->module = NULL;
-       fr_assert(request->dict == dict_dns);
+       fr_assert(request->proto_dict == dict_dns);
 
        UPDATE_STATE(packet);
 
index 9d12db58e54501b5d96b3bfef31d9e8819126705..d9f7fc2bcd4a6e7227f07369c301a4229e92428b 100644 (file)
@@ -113,7 +113,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "ldap_sync";
        request->module = NULL;
-       fr_assert(request->dict == dict_ldap_sync);
+       fr_assert(request->proto_dict == dict_ldap_sync);
 
        UPDATE_STATE(packet);
 
index 40432311200db7e723b41faac039ee69f369cbda..20e8eb713634fd6eef1a3b813def27faf9e64b71 100644 (file)
@@ -799,7 +799,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "radius";
        request->module = NULL;
-       fr_assert(request->dict == dict_radius);
+       fr_assert(request->proto_dict == dict_radius);
 
        fr_assert(FR_RADIUS_PACKET_CODE_VALID(request->packet->code));
 
@@ -845,7 +845,7 @@ static xlat_action_t xlat_func_radius_secret_verify(TALLOC_CTX *ctx, fr_dcursor_
 
        XLAT_ARGS(args, &secret);
 
-       if (request->dict != dict_radius) return XLAT_ACTION_FAIL;
+       if (request->proto_dict != dict_radius) return XLAT_ACTION_FAIL;
 
        MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_BOOL, NULL));
 
index 4dad0bd7e58261bb23f57c982b8e5ed92318027e..cc8531da43f280e147ab79ea04b34c938597d381 100644 (file)
@@ -1041,7 +1041,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "tacacs";
        request->module = NULL;
-       fr_assert(request->dict == dict_tacacs);
+       fr_assert(request->proto_dict == dict_tacacs);
 
        UPDATE_STATE(packet);
 
index f4793ccc83e38fc74cffb181ace7151704e5a616..dbbf67b4ac8ef463ed5f50f99074b6dd19a0a9b3 100644 (file)
@@ -96,7 +96,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "test";
        request->module = NULL;
-       fr_assert(request->dict == dict_test);
+       fr_assert(request->proto_dict == dict_test);
 
        UPDATE_STATE(packet);
 
index 9f3020c051710feaeee522d1312be52b81586021..753049bf91c291164c14cf5127065368d591d2b3 100644 (file)
@@ -178,7 +178,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "tls";
        request->module = NULL;
-       fr_assert(request->dict == dict_tls);
+       fr_assert(request->proto_dict == dict_tls);
 
        UPDATE_STATE(packet);
 
index cb0dcbfc38de1331d02d83a20ffa17c2b63c98a1..ea38ec1923bcaedbccf902402568c488c20a32be 100644 (file)
@@ -494,7 +494,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "radius";
        request->module = NULL;
-       fr_assert(request->dict == dict_radius);
+       fr_assert(request->proto_dict == dict_radius);
 
        UPDATE_STATE(packet);
 
index 8947eee3063fef9c9ba85f85d68087aba05e02b5..8d47e3f59e0cc37cb3e3a46113848e99c80de9f7 100644 (file)
@@ -212,7 +212,7 @@ static unlang_action_t mod_process(rlm_rcode_t *p_result, module_ctx_t const *mc
 
        request->component = "vmps";
        request->module = NULL;
-       fr_assert(request->dict == dict_vmps);
+       fr_assert(request->proto_dict == dict_vmps);
 
        UPDATE_STATE(packet);