]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove FLAG_HAS_REF
authorAlan T. DeKok <aland@freeradius.org>
Thu, 17 Dec 2020 14:53:02 +0000 (09:53 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 17 Dec 2020 14:53:18 +0000 (09:53 -0500)
it's now in the dictionary extensions

src/lib/util/dict.h
src/lib/util/dict_tokenize.c
src/lib/util/dict_validate.c
src/protocols/radius/base.c

index fa54c5dd5376ee376c329ec636ccbe835d23c997..7d2b43dab0f61b1a4c9addb9dc4c4fe7dda2e45d 100644 (file)
@@ -103,7 +103,6 @@ enum {
        FLAG_KEY_FIELD,                                 //!< this is a key field for a subsequent struct
        FLAG_BIT_FIELD,                                 //!< bit field inside of a struct
        FLAG_LENGTH_UINT16,                             //!< string / octets type is prefixed by uint16 of length
-       FLAG_HAS_REF,                                   //!< the attribute has a reference to somewhere else
 };
 
 #define fr_dict_attr_is_key_field(_da) ((_da)->flags.extra && ((_da)->flags.subtype == FLAG_KEY_FIELD))
index 166e8ce14433aa5eed7ad40557b53162a0d9bc61..2115f00ec699d873ce234f92b8d712f8bc73d4ed 100644 (file)
@@ -443,8 +443,6 @@ static int dict_process_flag_field(dict_tokenize_ctx_t *ctx, char *name, fr_type
                        }
 
                        *ref = talloc_strdup(ctx->fixup.pool, value);
-                       flags->extra = true;
-                       flags->subtype = FLAG_HAS_REF;
 
                } else if (strcmp(key, "clone") == 0) {
                        if (!value) {
index a55b2962f842a79bde2f016271be96dfaf011827..868cf86360de8be4b499bcc0a03b8cefb1cc2389 100644 (file)
@@ -166,7 +166,7 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
         */
        if (flags->extra) {
                if ((flags->subtype != FLAG_KEY_FIELD) && (flags->subtype != FLAG_LENGTH_UINT16) &&
-                   (flags->subtype != FLAG_BIT_FIELD) && (flags->subtype != FLAG_HAS_REF)) {
+                   (flags->subtype != FLAG_BIT_FIELD)) {
                        fr_strerror_const("The 'key' and 'length' flags cannot be used with any other flags.");
                        return false;
                }
@@ -221,11 +221,6 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
                        break;
 
                case FR_TYPE_TLV:
-                       if (flags->subtype != FLAG_HAS_REF) {
-                               fr_strerror_const("Invalid type for extra flag.");
-                               return false;
-                       }
-
                        ALLOW_FLAG(extra);
                        /* @todo - allow arrays of struct? */
                        ALLOW_FLAG(subtype);
@@ -244,18 +239,6 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
                        return false;
                }
 
-               if (flags->subtype == FLAG_HAS_REF) {
-                       if ((type != FR_TYPE_GROUP) && (type != FR_TYPE_TLV) && (type != FR_TYPE_STRUCT)) {
-                               fr_strerror_printf("The 'ref' flag cannot be used used with type %s",
-                                                  fr_table_str_by_value(fr_value_box_type_table, type, "<UNKNOWN>"));
-                               return false;
-                       }
-
-                       /*
-                        *      @todo - double-check refs here, and not in dict_read_process_attribute().
-                        */
-               }
-
                FORBID_OTHER_FLAGS(extra);
        }
 
index 3bb0bbedf430f42648b0ac908cda60e138f5c07e..457e234594563e3df8375e96e113cc32126f849b 100644 (file)
@@ -1166,12 +1166,8 @@ static bool attr_valid(UNUSED fr_dict_t *dict, fr_dict_attr_t const *parent,
         *      with refs.  It shouldn't appear anywhere else.
         */
        if (flags->extra) {
-               if (flags->subtype != FLAG_HAS_REF) {
-                       fr_strerror_const("Unsupported extension.");
-                       return false;
-               }
-
-               return true;
+               fr_strerror_const("Unsupported extension.");
+               return false;
        }
 
        if (flags->subtype > FLAG_ENCRYPT_ASCEND_SECRET) {