after creating unknown attribute, look it up by name. If it
exists, return that one. This lets us use unknown attributes
in the config files, and then have the decoder automatically
reference then when they're seen in the packets.
return NULL;
}
+ /*
+ * The config files may reference the unknown by name.
+ * If so, use the pre-defined name instead of an unknown
+ * one.
+ *
+ * @fixme: pass the root into this function!
+ */
+ da = fr_dict_attr_by_name(NULL, n->name);
+ if (da) {
+ fr_dict_unknown_free(&parent);
+ parent = n;
+ fr_dict_unknown_free(&parent);
+ return da;
+ }
+
/*
* Ensure the parent is freed at the same time as the
* unknown DA. This should be OK as we never parent