summaryrefslogtreecommitdiff
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@jmq.cz>2020-02-10 08:41:05 +0100
committerMaria Matejka <mq@ucw.cz>2021-10-13 19:09:04 +0200
commiteb937358c087eaeb6f209660cc7ecfe6d6eff739 (patch)
treeb21a471c3c7247eb226cee5cbc9bf887bae6023a /nest/rt-table.c
parentd5a32563df1653952937117133f09143929ff0c2 (diff)
Preference moved to RTA and set explicitly in protocols
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index eb306227..0b06be92 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -286,7 +286,6 @@ rte_get_temp(rta *a)
e->attrs = a;
e->id = 0;
e->flags = 0;
- e->pref = 0;
return e;
}
@@ -533,9 +532,9 @@ rte_better(rte *new, rte *old)
if (!rte_is_valid(new))
return 0;
- if (new->pref > old->pref)
+ if (new->attrs->pref > old->attrs->pref)
return 1;
- if (new->pref < old->pref)
+ if (new->attrs->pref < old->attrs->pref)
return 0;
if (new->attrs->src->proto->proto != old->attrs->src->proto->proto)
{
@@ -559,7 +558,7 @@ rte_mergable(rte *pri, rte *sec)
if (!rte_is_valid(pri) || !rte_is_valid(sec))
return 0;
- if (pri->pref != sec->pref)
+ if (pri->attrs->pref != sec->attrs->pref)
return 0;
if (pri->attrs->src->proto->proto != sec->attrs->src->proto->proto)
@@ -1080,7 +1079,6 @@ rte_same(rte *x, rte *y)
return
x->attrs == y->attrs &&
x->pflags == y->pflags &&
- x->pref == y->pref &&
(!x->attrs->src->proto->rte_same || x->attrs->src->proto->rte_same(x, y)) &&
rte_is_filtered(x) == rte_is_filtered(y);
}
@@ -1469,9 +1467,6 @@ rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
new->net = nn;
new->sender = c;
- if (!new->pref)
- new->pref = c->preference;
-
stats->imp_updates_received++;
if (!rte_validate(new))
{
@@ -1710,7 +1705,7 @@ rte_dump(rte *e)
{
net *n = e->net;
debug("%-1N ", n->n.addr);
- debug("PF=%02x pref=%d ", e->pflags, e->pref);
+ debug("PF=%02x ", e->pflags);
rta_dump(e->attrs);
if (e->attrs->src->proto->proto->dump_attrs)
e->attrs->src->proto->proto->dump_attrs(e);
@@ -2222,7 +2217,7 @@ rt_next_hop_update_rte(rtable *tab UNUSED, rte *old)
memcpy(mls.stack, &a->nh.label[a->nh.labels - mls.len], mls.len * sizeof(u32));
rta_apply_hostentry(a, old->attrs->hostentry, &mls);
- a->aflags = 0;
+ a->cached = 0;
rte *e = sl_alloc(rte_slab);
memcpy(e, old, sizeof(rte));
@@ -2576,9 +2571,6 @@ rte_update_in(struct channel *c, const net_addr *n, rte *new, struct rte_src *sr
{
net = net_get(tab, n);
- if (!new->pref)
- new->pref = c->preference;
-
if (!rta_is_cached(new->attrs))
new->attrs = rta_lookup(new->attrs);
}