From: Maria Matejka Date: Fri, 7 Jun 2024 19:41:17 +0000 (+0200) Subject: Attributes: cleanup X-Git-Tag: v3.0.0~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=602595fe10b67da87bdc313b4bf3c36654df637f;p=thirdparty%2Fbird.git Attributes: cleanup Dropping EAF_TYPE__MAX and adding a check for forgotten ea class registration --- diff --git a/filter/f-inst.c b/filter/f-inst.c index 2fed0543b..6c3724ad7 100644 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@ -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: diff --git a/lib/route.h b/lib/route.h index 0ef97f017..e73077134 100644 --- a/lib/route.h +++ b/lib/route.h @@ -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, diff --git a/lib/type.h b/lib/type.h index 2edaa2e4e..c7b116c5d 100644 --- a/lib/type.h +++ b/lib/type.h @@ -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 */