diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-03 01:50:39 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-03 03:24:59 +0200 |
commit | b748db674ab6838f31c47f394350ab850ba22748 (patch) | |
tree | d05a3a9a41969022fab410fd7c6108033906a1fc /eigrpd/eigrp_network.c | |
parent | eigrpd: Start fixing eigrp_interface (diff) | |
download | frr-b748db674ab6838f31c47f394350ab850ba22748.tar.xz frr-b748db674ab6838f31c47f394350ab850ba22748.zip |
eigrpd: Remove ei mapping to connected routes
We need one struct eigrp_interface per ifp structure
not a ifp->info structure with a ei per connected.
Some minor code cleanup as well with macros and
their weird usage.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_network.c')
-rw-r--r-- | eigrpd/eigrp_network.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/eigrpd/eigrp_network.c b/eigrpd/eigrp_network.c index c5f408031..50e6b7b3b 100644 --- a/eigrpd/eigrp_network.c +++ b/eigrpd/eigrp_network.c @@ -271,6 +271,7 @@ static int eigrp_network_match_iface(const struct connected *co, static void eigrp_network_run_interface(struct eigrp *eigrp, struct prefix *p, struct interface *ifp) { + struct eigrp_interface *ei; struct listnode *cnode; struct connected *co; @@ -282,24 +283,15 @@ static void eigrp_network_run_interface(struct eigrp *eigrp, struct prefix *p, continue; if (p->family == co->address->family - && !eigrp_if_table_lookup(ifp, co->address) + && !ifp->info && eigrp_network_match_iface(co, p)) { - struct eigrp_interface *ei; ei = eigrp_if_new(eigrp, ifp, co->address); ei->connected = co; - ei->params = eigrp_lookup_if_params( - ifp, ei->address->u.prefix4); - /* Relate eigrp interface to eigrp instance. */ ei->eigrp = eigrp; - /* update network type as interface flag */ - /* If network type is specified previously, - skip network type setting. */ - ei->type = IF_DEF_PARAMS(ifp)->type; - /* if router_id is not configured, dont bring up * interfaces. * eigrp_router_id_update() will call eigrp_if_update @@ -415,16 +407,17 @@ u_int32_t eigrp_calculate_metrics(struct eigrp *eigrp, u_int32_t eigrp_calculate_total_metrics(struct eigrp *eigrp, struct eigrp_nexthop_entry *entry) { + struct eigrp_interface *ei = entry->ei; + entry->total_metric = entry->reported_metric; uint64_t temp_delay = (uint64_t)entry->total_metric.delay - + (uint64_t)eigrp_delay_to_scaled( - EIGRP_IF_PARAM(entry->ei, delay)); + + (uint64_t)eigrp_delay_to_scaled(ei->params.delay); entry->total_metric.delay = temp_delay > EIGRP_MAX_METRIC ? EIGRP_MAX_METRIC : (u_int32_t)temp_delay; u_int32_t bw = - eigrp_bandwidth_to_scaled(EIGRP_IF_PARAM(entry->ei, bandwidth)); + eigrp_bandwidth_to_scaled(ei->params.bandwidth); entry->total_metric.bandwidth = entry->total_metric.bandwidth > bw ? bw : entry->total_metric.bandwidth; |