because when we clone structs/TLVs, we clone attributes of many
types. So we might as well allow it here, too
return -1;
}
- if ((type != FR_TYPE_TLV) && (type != FR_TYPE_STRUCT) &&
- !(flags->extra && (flags->subtype == FLAG_KEY_FIELD))) {
- fr_strerror_printf("The 'clone' flag cannot be used for type '%s'",
- fr_table_str_by_value(fr_value_box_type_table, type, "<UNKNOWN>"));
- return -1;
- }
-
+ /*
+ * Allow cloning of any types, so long as
+ * the types are the same. We do the checks later.
+ */
*ref = talloc_strdup(ctx->fixup.pool, value);
} else if (ctx->dict->subtype_table) {
fr_dict_attr_t const *child = NULL;
fr_dict_attr_t *copy;
- if ((dst->type != FR_TYPE_TLV) && (dst->type != FR_TYPE_STRUCT) && !fr_dict_attr_is_key_field(src)) {
- fr_strerror_printf_push("Invalid destination type %s",
- fr_table_str_by_value(fr_value_box_type_table, dst->type, "<UNKNOWN>"));
- return -1;
- }
-
fr_assert(fr_dict_attr_has_ext(dst, FR_DICT_ATTR_EXT_CHILDREN));
fr_assert(dst->type == src->type);
fr_assert(fr_dict_attr_is_key_field(src) == fr_dict_attr_is_key_field(dst));