1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

IGP metric getter refactoring to protocol callback

Direct protocol hooks for IGP metric inside nest/rt-table.c make the
protocol API unnecessarily complex. Instead, we use a proper callback.
This commit is contained in:
Maria Matejka
2021-03-20 23:18:34 +01:00
parent 5cff1d5f02
commit d471d5fc7c
8 changed files with 34 additions and 32 deletions

View File

@@ -1098,6 +1098,11 @@ rip_rte_same(struct rte *new, struct rte *old)
(new->u.rip.from == old->u.rip.from));
}
static u32
rip_rte_igp_metric(struct rte *rt)
{
return rt->u.rip.metric;
}
static void
rip_postconfig(struct proto_config *CF)
@@ -1124,6 +1129,7 @@ rip_init(struct proto_config *CF)
P->store_tmp_attrs = rip_store_tmp_attrs;
P->rte_better = rip_rte_better;
P->rte_same = rip_rte_same;
P->rte_igp_metric = rip_rte_igp_metric;
return P;
}