and unknown attributes can allocate EXT_VENDOR
which helps with unknown VSAs. They previously result in a
Vendor-Specific { Foo { } } being allocated, and then an error
returned of "dict is read only".
At that point, the decoder would then create a raw top-level
attribute
*/
#ifndef NDEBUG
if ((*da_out_p)->flags.is_unknown && ((*da_out_p)->type == FR_TYPE_OCTETS)) {
- fr_assert(ext == FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC);
+ fr_assert((ext == FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC) || (ext == FR_DICT_ATTR_EXT_VENDOR));
}
#endif
{
fr_dict_attr_t *da = *da_p;
-
if (unlikely((*da_p)->type == FR_TYPE_NULL)) {
fr_strerror_const("Attribute type must be set before initialising parent. Use dict_attr_type_init() first");
return -1;
if (unlikely(dict_attr_type_init(da_p, type) < 0)) return -1;
+ if (args->flags) (*da_p)->flags = *args->flags;
+
if (parent && (dict_attr_parent_init(da_p, parent) < 0)) return -1;
if (args->ref && (dict_attr_ref_aset(da_p, args->ref, FR_DICT_ATTR_REF_ALIAS) < 0)) return -1;
- if (args->flags) (*da_p)->flags = *args->flags;
-
return 0;
}