*/
switch (da_stack->da[depth]->type) {
case FR_TYPE_TLV:
- if (!da_stack->da[depth + 1]) goto do_child;
+ if (!da_stack->da[depth + 1]) goto do_nested_children;
return encode_tlv(dbuff, da_stack, depth, cursor, encode_ctx);
case FR_TYPE_VSA:
- if (!da_stack->da[depth + 1]) goto do_child;
+ if (!da_stack->da[depth + 1]) goto do_nested_children;
return encode_vsio(dbuff, da_stack, depth, cursor, encode_ctx);
}
}
-do_child:
+do_nested_children:
fr_pair_dcursor_init(&child_cursor, &vp->vp_group);
work_dbuff = FR_DBUFF(dbuff);
*/
switch (da_stack->da[depth]->type) {
case FR_TYPE_TLV:
- if (!da_stack->da[depth + 1]) goto do_child;
+ if (!da_stack->da[depth + 1]) goto do_nested_children;
return encode_tlv(dbuff, da_stack, depth, cursor, encode_ctx);
case FR_TYPE_VSA:
- if (!da_stack->da[depth + 1]) goto do_child;
+ if (!da_stack->da[depth + 1]) goto do_nested_children;
return encode_vsio(dbuff, da_stack, depth, cursor, encode_ctx);
case FR_TYPE_GROUP:
- if (!da_stack->da[depth + 1]) goto do_child;
+ if (!da_stack->da[depth + 1]) goto do_nested_children;
FALL_THROUGH;
default:
}
}
-do_child:
+do_nested_children:
fr_pair_dcursor_init(&child_cursor, &vp->vp_group);
work_dbuff = FR_DBUFF(dbuff);
*/
switch (da_stack->da[depth]->type) {
case FR_TYPE_TLV:
- if (!da_stack->da[depth + 1]) goto do_child;
+ if (!da_stack->da[depth + 1]) goto do_nested_children;
return encode_tlv(dbuff, da_stack, depth, cursor, encode_ctx);
case FR_TYPE_GROUP:
- if (!da_stack->da[depth + 1]) goto do_child;
+ if (!da_stack->da[depth + 1]) goto do_nested_children;
FALL_THROUGH;
default:
}
}
-do_child:
+do_nested_children:
fr_pair_dcursor_init(&child_cursor, &vp->vp_group);
work_dbuff = FR_DBUFF(dbuff);
hlen = 2;
FR_DBUFF_IN_BYTES_RETURN(&work_dbuff, (uint8_t)da_stack->da[depth]->attr, hlen);
+ fr_assert(da_stack->da[depth] != NULL);
+ fr_assert(fr_type_is_leaf(da_stack->da[depth]->type));
+
slen = encode_value(&work_dbuff, da_stack, depth, cursor, encode_ctx);
if (slen <= 0) return slen;