so that the code works properly in both cases
}
/*
- * Pass in the root for type attr, so that we can find the reference.
+ * Pass in the DA. The value-box parsing functions will figure out where the enums are found.
*/
- if (da->type == FR_TYPE_ATTR) enumv = fr_dict_root(da->dict);
+ if (da->type == FR_TYPE_ATTR) enumv = da;
if (fr_value_box_from_str(NULL, &value, da->type, enumv,
argv[2], strlen(argv[2]),
* carry a ref to where their values are taken from.
*/
if (dst_enumv->type == FR_TYPE_ATTR) {
- dst_enumv = fr_dict_root(dst_enumv->dict);
+ if (!dst_enumv->flags.has_value) dst_enumv = fr_dict_root(dst_enumv->dict);
} else if (!dst_enumv->flags.is_root) {
- fr_strerror_printf("Can only start from dictionary root for data type 'attr', and not from %s", dst_enumv->name);
+ fr_strerror_printf("Can only start from dictionary root for data type 'attribute', and not from %s", dst_enumv->name);
return -1;
}