unsigned int vsa_parent; //!< varies with different protocols
int default_type_size; //!< for TLVs and VSAs
int default_type_length; //!< for TLVs and VSAs
+ unsigned int self_allocated; //!< track attribute numbers for self allocations
dl_t *dl; //!< for validation
/******************** sanity check attribute number ********************/
if (parent->flags.is_root) {
- static unsigned int max_attr = UINT8_MAX + 1;
-
+ /*
+ * The value -1 is the special flag for "self
+ * allocated" numbers. i.e. we want an
+ * attribute, but we don't care what the number
+ * is.
+ */
if (*attr == -1) {
flags->internal = 1;
fr_strerror_printf("Conflicting definition for attribute %s", name);
return false;
}
- *attr = ++max_attr;
+ *attr = ++dict->self_allocated;
} else if (*attr <= 0) {
fr_strerror_printf("ATTRIBUTE number %i is invalid, must be greater than zero", *attr);
return false;
- } else if ((unsigned int) *attr > max_attr) {
- max_attr = *attr;
+ } else if ((unsigned int) *attr > dict->self_allocated) {
+ dict->self_allocated = *attr;
}
/*