summaryrefslogtreecommitdiff
path: root/proto/rip/rip.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2021-03-20 23:18:34 +0100
committerMaria Matejka <mq@ucw.cz>2021-10-13 19:09:04 +0200
commitd471d5fc7ce587ed836ca7fa10a79331bc181d45 (patch)
tree557c529dde26bf83da31b5ddcacd5d842d9421bd /proto/rip/rip.c
parent5cff1d5f022755df61af6fc21cc4f2e5d384404e (diff)
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.
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r--proto/rip/rip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index f2e56e93..2653b23b 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -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;
}