the length is not fixed, but is instead dependent on the length
of the label. However, unlike normal "string" attributes, the
field is delimited, so we can figure out the length just by
looking at the data.
{
switch (vp->vp_type) {
case FR_TYPE_VARIABLE_SIZE:
+#ifndef NDEBUG
+ if (!vp->da->flags.extra &&
+ ((vp->da->flags.subtype == FLAG_ENCODE_DNS_LABEL) ||
+ (vp->da->flags.subtype == FLAG_ENCODE_PARTIAL_DNS_LABEL))) {
+ fr_assert_fail("DNS labels MUST be encoded/decoded with their own function, and not with generic 'string' functions");
+ return 0;
+ }
+#endif
+
if (vp->da->flags.length) return vp->da->flags.length; /* Variable type with fixed length */
return vp->vp_length;