diff options
author | Maria Matejka <mq@ucw.cz> | 2021-03-20 23:18:34 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2021-10-13 19:09:04 +0200 |
commit | d471d5fc7ce587ed836ca7fa10a79331bc181d45 (patch) | |
tree | 557c529dde26bf83da31b5ddcacd5d842d9421bd /proto/babel/babel.c | |
parent | 5cff1d5f022755df61af6fc21cc4f2e5d384404e (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/babel/babel.c')
-rw-r--r-- | proto/babel/babel.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |