0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

Attributes: cleanup

Dropping EAF_TYPE__MAX and adding a check for forgotten
ea class registration
This commit is contained in:
Maria Matejka 2024-06-07 21:41:17 +02:00
parent bf961ba405
commit 602595fe10
3 changed files with 3 additions and 4 deletions

View File

@ -907,9 +907,6 @@
{
struct eattr *a;
if (da->type >= EAF_TYPE__MAX)
bug("Unsupported attribute type");
switch (da->type) {
case T_IFACE:
case T_OPAQUE:

View File

@ -380,6 +380,9 @@ void ea_list_copy(ea_list *dest, ea_list *src, uint size);
static inline eattr *
ea_set_attr(ea_list **to, eattr a)
{
if (!a.id)
bug("You have forgotten to register your EA class");
EA_LOCAL_LIST(1) *ea = tmp_alloc(sizeof(*ea));
*ea = (typeof(*ea)) {
.l.flags = EALF_SORTED,

View File

@ -78,7 +78,6 @@ enum btype {
T_ENUM_RA_PREFERENCE = 0x15, /* RA Preference enum */
T_ENUM_FLOWSPEC_VALID = 0x17, /* Flowspec validation result */
#define EAF_TYPE__MAX 0x1f
#define EAF_EMBEDDED 0x01 /* Data stored in eattr.u.data (part of type spec) */
/* Otherwise, attribute data is adata */