}
break;
/*
- * This covers unresolved attributes as well as
- * unresolved functions.
+ * Virtual unresolved attributes get
+ * resolved to functions, and failing
+ * that to a dictionary attribute.
*/
case XLAT_VIRTUAL_UNRESOLVED:
{
node->flags = (xlat_flags_t){ .needs_async = func->needs_async };
break;
}
+ FALL_THROUGH;
+ /*
+ * An unresolved attribute
+ */
+ case XLAT_ATTRIBUTE:
/*
* Try and resolve (in-place) as an attribute
*/
- if ((tmpl_resolve(node->attr) < 0) || (node->attr->type != TMPL_TYPE_ATTR)) {
+ if ((tmpl_resolve(node->attr) < 0) || (!tmpl_is_attr(node->attr))) {
/*
* FIXME - Produce proper error with marker
*/
if (!allow_unresolved) {
- error_unresolved:
fr_strerror_printf_push("Failed resolving attribute in expansion %%{%s}",
node->fmt);
return -1;
}
break;
- case XLAT_ATTRIBUTE:
- if (!allow_unresolved) goto error_unresolved;
- break;
-
default:
fr_assert(0); /* Should not have been marked as unresolved */
return -1;