0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-18 17:18:42 +00:00

Merge branch 'backport' into thread-next

This commit is contained in:
Maria Matejka 2022-08-05 11:14:33 +02:00
commit 95d970d7a0

View File

@ -1121,24 +1121,18 @@ rip_rte_proto(struct rte *rte)
SKIP_BACK(struct rip_proto, p.sources, rte->src->owner) : NULL; SKIP_BACK(struct rip_proto, p.sources, rte->src->owner) : NULL;
} }
static int
rip_rte_better(struct rte *new, struct rte *old)
{
ASSERT_DIE(new->src == old->src);
struct rip_proto *p = rip_rte_proto(new);
u32 new_metric = ea_get_int(new->attrs, &ea_rip_metric, p->infinity);
u32 old_metric = ea_get_int(old->attrs, &ea_rip_metric, p->infinity);
return new_metric < old_metric;
}
static u32 static u32
rip_rte_igp_metric(const rte *rt) rip_rte_igp_metric(const rte *rt)
{ {
return ea_get_int(rt->attrs, &ea_rip_metric, IGP_METRIC_UNKNOWN); return ea_get_int(rt->attrs, &ea_rip_metric, IGP_METRIC_UNKNOWN);
} }
static int
rip_rte_better(struct rte *new, struct rte *old)
{
return rip_rte_igp_metric(new) < rip_rte_igp_metric(old);
}
static void static void
rip_postconfig(struct proto_config *CF) rip_postconfig(struct proto_config *CF)
{ {