diff options
Diffstat (limited to 'nest')
-rw-r--r-- | nest/route.h | 6 | ||||
-rw-r--r-- | nest/rt-attr.c | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/nest/route.h b/nest/route.h index 595acabd..9fbac898 100644 --- a/nest/route.h +++ b/nest/route.h @@ -502,7 +502,9 @@ static inline int rte_is_reachable(rte *r) typedef struct eattr { word id; /* EA_CODE(PROTOCOL_..., protocol-dependent ID) */ byte flags; /* Protocol-dependent flags */ - byte type; /* Attribute type and several flags (EAF_...) */ + byte type:5; /* Attribute type */ + byte originated:1; /* The attribute has originated locally */ + byte fresh:1; /* An uncached attribute (e.g. modified in export filter) */ union { uintptr_t data; const struct adata *ptr; /* Attribute data elsewhere */ @@ -541,8 +543,6 @@ const char *ea_custom_name(uint ea); #define EAF_TYPE_UNDEF 0x1f /* `force undefined' entry */ #define EAF_EMBEDDED 0x01 /* Data stored in eattr.u.data (part of type spec) */ #define EAF_VAR_LENGTH 0x02 /* Attribute length is variable (part of type spec) */ -#define EAF_ORIGINATED 0x20 /* The attribute has originated locally */ -#define EAF_FRESH 0x40 /* An uncached attribute (e.g. modified in export filter) */ typedef struct adata { uint length; /* Length of data */ diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 863d411b..2f0395c7 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -623,7 +623,10 @@ ea_do_prune(ea_list *e) *d = *s0; /* Preserve info whether it originated locally */ - d->type = (d->type & ~(EAF_ORIGINATED|EAF_FRESH)) | (s[-1].type & EAF_ORIGINATED); + d->originated = s[-1].originated; + + /* Not fresh any more, we prefer surstroemming */ + d->fresh = 0; /* Next destination */ d++; @@ -737,6 +740,8 @@ ea_same(ea_list *x, ea_list *y) if (a->id != b->id || a->flags != b->flags || a->type != b->type || + a->originated != b->originated || + a->fresh != b->fresh || ((a->type & EAF_EMBEDDED) ? a->u.data != b->u.data : !adata_same(a->u.ptr, b->u.ptr))) return 0; } @@ -1004,7 +1009,7 @@ ea_dump(ea_list *e) eattr *a = &e->attrs[i]; debug(" %02x:%02x.%02x", EA_PROTO(a->id), EA_ID(a->id), a->flags); debug("=%c", "?iO?I?P???S?????" [a->type & EAF_TYPE_MASK]); - if (a->type & EAF_ORIGINATED) + if (a->originated) debug("o"); if (a->type & EAF_EMBEDDED) debug(":%08x", a->u.data); |