summaryrefslogtreecommitdiff
path: root/proto/rip/rip.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-10-04 16:09:41 +0200
committerMaria Matejka <mq@ucw.cz>2022-10-04 16:09:41 +0200
commitf69ba3921a1842f9cac9b9fbd0a32800615da02e (patch)
tree25d3b5b4ef7ffc4fb9937d6f48806934f4da2b62 /proto/rip/rip.c
parenta414ba6b975a1187a59cac1f58bc68e5e4b7d37d (diff)
parentfb7fb6744582b2bb74b3b1e32696bd5534e93054 (diff)
Merge commit 'fb7fb674' into HEAD
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r--proto/rip/rip.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index ab0e3f4b..183fc265 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -1121,24 +1121,18 @@ rip_rte_proto(struct rte *rte)
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
rip_rte_igp_metric(const rte *rt)
{
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
rip_postconfig(struct proto_config *CF)
{