summaryrefslogtreecommitdiffstats
path: root/nest/rt-attr.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-04-17 13:23:05 +0200
committerMartin Mares <mj@ucw.cz>2000-04-17 13:23:05 +0200
commit51a183af78a330cca46f12dcbff79bb045c4c854 (patch)
tree301288a4402b62fc433556ea4d37df65232d9991 /nest/rt-attr.c
parent4b03f64b341db7b73eedc00bc5321fedf349a236 (diff)
downloadbird-51a183af78a330cca46f12dcbff79bb045c4c854.tar
bird-51a183af78a330cca46f12dcbff79bb045c4c854.zip
Define EAF_ORIGINATED and propagate it properly when merging attribute lists.
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r--nest/rt-attr.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index c16d08b..42317e9 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -117,7 +117,7 @@ ea_do_sort(ea_list *e)
static inline void
ea_do_prune(ea_list *e)
{
- eattr *s, *d, *l;
+ eattr *s, *d, *l, *s0;
int i = 0;
/* Discard duplicates and undefs. Do you remember sorting was stable? */
@@ -125,14 +125,17 @@ ea_do_prune(ea_list *e)
l = e->attrs + e->count;
while (s < l)
{
- if ((s->type & EAF_TYPE_MASK) != EAF_TYPE_UNDEF)
+ s0 = s++;
+ while (s < l && s->id == s[-1].id)
+ s++;
+ /* s0 is the most recent version, s[-1] the oldest one */
+ if ((s0->type & EAF_TYPE_MASK) != EAF_TYPE_UNDEF)
{
- *d++ = *s;
+ *d = *s0;
+ d->type = (d->type & ~EAF_ORIGINATED) | (s[-1].type & EAF_ORIGINATED);
+ d++;
i++;
}
- s++;
- while (s < l && s->id == s[-1].id)
- s++;
}
e->count = i;
}
@@ -320,6 +323,8 @@ ea_dump(ea_list *e)
if (a->type & EAF_TEMP)
debug("T");
debug("=%c", "?iO?I?P???S?????" [a->type & EAF_TYPE_MASK]);
+ if (a->type & EAF_ORIGINATED)
+ debug("o");
if (a->type & EAF_EMBEDDED)
debug(":%08x", a->u.data);
else