diff options
Diffstat (limited to 'nest')
-rw-r--r-- | nest/protocol.h | 2 | ||||
-rw-r--r-- | nest/rt-attr.c | 2 | ||||
-rw-r--r-- | nest/rt-table.c | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/nest/protocol.h b/nest/protocol.h index 1d7dea4b..aeb60ac6 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -192,7 +192,7 @@ struct proto { struct rte *(*rte_modify)(struct rte *, struct linpool *); void (*rte_insert)(struct network *, struct rte *); void (*rte_remove)(struct network *, struct rte *); - u32 (*rte_igp_metric)(struct rte *); + u32 (*rte_igp_metric)(const struct rte *); /* Hic sunt protocol-specific data */ }; diff --git a/nest/rt-attr.c b/nest/rt-attr.c index a763db4d..6bb27623 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -1225,7 +1225,6 @@ rta_hash(rta *a) #define BMIX(f) mem_hash_mix_num(&h, a->f); MIX(hostentry); MIX(from); - MIX(igp_metric); BMIX(source); BMIX(scope); BMIX(dest); @@ -1241,7 +1240,6 @@ rta_same(rta *x, rta *y) return (x->source == y->source && x->scope == y->scope && x->dest == y->dest && - x->igp_metric == y->igp_metric && ipa_equal(x->from, y->from) && x->hostentry == y->hostentry && nexthop_same(&(x->nh), &(y->nh)) && diff --git a/nest/rt-table.c b/nest/rt-table.c index 849f6766..d89c087d 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2505,7 +2505,8 @@ rta_apply_hostentry(rta *a, struct hostentry *he, mpls_label_stack *mls) { a->hostentry = he; a->dest = he->dest; - a->igp_metric = he->igp_metric; + + ea_set_attr_u32(&a->eattrs, &ea_gen_igp_metric, 0, he->igp_metric); if (a->dest != RTD_UNICAST) { @@ -2602,7 +2603,8 @@ rta_next_hop_outdated(rta *a) if (!he->src) return a->dest != RTD_UNREACHABLE; - return (a->dest != he->dest) || (a->igp_metric != he->igp_metric) || + return (a->dest != he->dest) || + (ea_get_int(a->eattrs, &ea_gen_igp_metric, IGP_METRIC_UNKNOWN) != he->igp_metric) || (!he->nexthop_linkable) || !nexthop_same(&(a->nh), &(he->src->nh)); } @@ -3534,7 +3536,7 @@ if_local_addr(ip_addr a, struct iface *i) } u32 -rt_get_igp_metric(rte *rt) +rt_get_igp_metric(const rte *rt) { eattr *ea = ea_find(rt->attrs->eattrs, "igp_metric"); |