From d471d5fc7ce587ed836ca7fa10a79331bc181d45 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sat, 20 Mar 2021 23:18:34 +0100 Subject: 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. --- proto/babel/babel.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'proto/babel') diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 1d23aef7..d17f318b 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -2332,6 +2332,12 @@ babel_rte_same(struct rte *new, struct rte *old) (new->u.babel.router_id == old->u.babel.router_id)); } +static u32 +babel_rte_igp_metric(struct rte *rt) +{ + return rt->u.babel.metric; +} + static void babel_postconfig(struct proto_config *CF) @@ -2367,6 +2373,7 @@ babel_init(struct proto_config *CF) P->store_tmp_attrs = babel_store_tmp_attrs; P->rte_better = babel_rte_better; P->rte_same = babel_rte_same; + P->rte_igp_metric = babel_rte_igp_metric; return P; } -- cgit v1.2.3