]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow references to the "internal" dictionaries, too
authorAlan T. DeKok <aland@freeradius.org>
Thu, 12 Aug 2021 15:07:36 +0000 (11:07 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 12 Aug 2021 15:07:36 +0000 (11:07 -0400)
src/lib/util/dict_util.c

index df294872fb20e64fed7c99020f35bdcc6ba137e5..f0df844ffe3db36168cdcd796cea9d9fec38aa86 100644 (file)
@@ -1923,9 +1923,13 @@ ssize_t dict_by_protocol_substr(fr_dict_attr_err_t *err,
        dict = fr_hash_table_find(dict_gctx->protocol_by_name, &(fr_dict_t){ .root = &root });
 
        if (!dict) {
-               fr_strerror_printf("Unknown protocol '%s'", root.name);
-               memcpy(out, &dict_def, sizeof(*out));
-               return 0;
+               if (strcasecmp(root.name, "internal") != 0) {
+                       fr_strerror_printf("Unknown protocol '%s'", root.name);
+                       memcpy(out, &dict_def, sizeof(*out));
+                       return 0;
+               }
+
+               dict = dict_gctx->internal;
        }
 
        *out = dict;