fr_dict_attr_flags_t flags = {
.is_root = 1,
- .type_size = 1,
- .length = 1
+ .type_size = dict->proto->default_type_size,
+ .length = dict->proto->default_type_length,
};
if (!fr_cond_assert(!dict->root)) {
unsigned int value;
unsigned int type_size = 0;
fr_dict_t *dict;
- fr_dict_attr_t *mutable;
unsigned int required_value;
char const *required_name;
bool require_dl = false;
if (dict_protocol_add(dict) < 0) goto error;
- mutable = UNCONST(fr_dict_attr_t *, dict->root);
dict->string_based = string_based;
- if (!type_size) {
- mutable->flags.type_size = dict->proto->default_type_size;
- mutable->flags.length = dict->proto->default_type_length;
- } else {
+ if (type_size) {
+ fr_dict_attr_t *mutable;
+
+ mutable = UNCONST(fr_dict_attr_t *, dict->root);
mutable->flags.type_size = type_size;
mutable->flags.length = 1; /* who knows... */
}
.is_root = true,
.local = true,
.internal = true,
- .type_size = 2,
- .length = 2
+ .type_size = parent->root->flags.type_size,
+ .length = parent->root->flags.length,
};
dict = dict_alloc(UNCONST(fr_dict_t *, parent));