fr_strerror_printf("The 'length' flag can only be used with value 'uint16'");
}
- if ((type != FR_TYPE_STRING) && (type != FR_TYPE_OCTETS) && (type != FR_TYPE_STRUCT)) {
- fr_strerror_printf("The 'length' flag can only be used for attributes of type 'string' or 'octets'");
- return -1;
- }
-
flags->extra = 1;
flags->subtype = FLAG_LENGTH_UINT16;
if ((flags->subtype == FLAG_LENGTH_UINT16) &&
((type != FR_TYPE_STRING) && (type != FR_TYPE_OCTETS) && (type != FR_TYPE_STRUCT))) {
- fr_strerror_printf("The 'length' flag can only be used for attributes of type 'string' or 'octets'");
- return -1;
- }
+ fr_strerror_printf("The 'length' flag cannot be used used with type %s",
+ fr_table_str_by_value(fr_value_box_type_table, type, "<UNKNOWN>"));
+ return -1;
+ }
FORBID_OTHER_FLAGS(extra);
}