diff options
author | Maria Matejka <mq@ucw.cz> | 2022-03-09 11:01:44 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-03-09 11:02:55 +0100 |
commit | 24773af9e099530aa6ccf4c730ad31c452284228 (patch) | |
tree | 373d1835e6b16a4946690fa467f89eba8b0a58b7 /proto/bgp | |
parent | 83d9920f90738e4df75b3cf57335b43c094051cd (diff) | |
parent | e42eedb912428aa9af450b0426e53b0a7004dfb1 (diff) |
Merge commit 'e42eedb9' into haugesund
Diffstat (limited to 'proto/bgp')
-rw-r--r-- | proto/bgp/attrs.c | 7 | ||||
-rw-r--r-- | proto/bgp/bgp.c | 1 | ||||
-rw-r--r-- | proto/bgp/bgp.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 09c0bc57..6963833a 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -374,6 +374,13 @@ bgp_init_aigp_metric(rte *e, u64 *metric, const struct adata **ad) return *metric < IGP_METRIC_UNKNOWN; } +u32 +bgp_rte_igp_metric(struct rte *rt) +{ + u64 metric = bgp_total_aigp_metric(rt); + return (u32) MIN(metric, (u64) IGP_METRIC_UNKNOWN); +} + /* * Attribute hooks diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index b5a31ab7..52400762 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -1679,6 +1679,7 @@ bgp_init(struct proto_config *CF) P->rte_mergable = bgp_rte_mergable; P->rte_recalculate = cf->deterministic_med ? bgp_rte_recalculate : NULL; P->rte_modify = bgp_rte_modify_stale; + P->rte_igp_metric = bgp_rte_igp_metric; p->cf = cf; p->is_internal = (cf->local_as == cf->remote_as); diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index 9d25da21..26e04966 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -584,6 +584,7 @@ int bgp_rte_better(struct rte *, struct rte *); int bgp_rte_mergable(rte *pri, rte *sec); int bgp_rte_recalculate(rtable *table, net *net, rte *new, rte *old, rte *old_best); struct rte *bgp_rte_modify_stale(struct rte *r, struct linpool *pool); +u32 bgp_rte_igp_metric(struct rte *); void bgp_rt_notify(struct proto *P, struct channel *C, net *n, rte *new, rte *old); int bgp_preexport(struct proto *, struct rte *); int bgp_get_attr(const struct eattr *e, byte *buf, int buflen); |