diff options
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r-- | proto/rip/rip.c | 18 |
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) { |