diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-03-10 14:20:40 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-03-10 14:20:40 +0100 |
| commit | 098c0eb8f4c2922e5f8ef4b0a6f99f7114d23b4d (patch) | |
| tree | 97cf019431f59e58e9bb03958e02a13e883206ef /zebra/zebra_rnh.c | |
| parent | 17791cc09ac79a1ee54de1626f85f95039fb506e (diff) | |
| parent | b32cba291bcf4661b5c4853ed76087580ba763eb (diff) | |
Merge branch 'stable/2.0'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_rnh.c')
| -rw-r--r-- | zebra/zebra_rnh.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 71ee8975b5..67859fd46b 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -629,9 +629,6 @@ zebra_rnh_eval_nexthop_entry (vrf_id_t vrfid, int family, int force, */ if (!prefix_same(&rnh->resolved_route, &prn->p)) { - if (rib) - UNSET_FLAG(rib->status, RIB_ENTRY_NEXTHOPS_CHANGED); - if (prn) prefix_copy(&rnh->resolved_route, &prn->p); else @@ -642,9 +639,6 @@ zebra_rnh_eval_nexthop_entry (vrf_id_t vrfid, int family, int force, } else if (compare_state(rib, rnh->state)) { - if (rib) - UNSET_FLAG(rib->status, RIB_ENTRY_NEXTHOPS_CHANGED); - copy_state(rnh, rib, nrn); state_changed = 1; } @@ -701,6 +695,30 @@ zebra_rnh_evaluate_entry (vrf_id_t vrfid, int family, int force, rnh_type_t type nrn, rnh, prn, rib); } +/* + * Clear the RIB_ENTRY_NEXTHOPS_CHANGED flag + * from the rib entries. + * + * Please note we are doing this *after* we have + * notified the world about each nexthop as that + * we can have a situation where one rib entry + * covers multiple nexthops we are interested in. + */ +static void +zebra_rnh_clear_nhc_flag (vrf_id_t vrfid, int family, rnh_type_t type, + struct route_node *nrn) +{ + struct rnh *rnh; + struct rib *rib; + struct route_node *prn; + + rnh = nrn->info; + + rib = zebra_rnh_resolve_entry (vrfid, family, type, nrn, rnh, &prn); + + if (rib) + UNSET_FLAG (rib->status, RIB_ENTRY_NEXTHOPS_CHANGED); +} /* Evaluate all tracked entries (nexthops or routes for import into BGP) * of a particular VRF and address-family or a specific prefix. @@ -722,6 +740,7 @@ zebra_evaluate_rnh (vrf_id_t vrfid, int family, int force, rnh_type_t type, nrn = route_node_lookup (rnh_table, p); if (nrn && nrn->info) zebra_rnh_evaluate_entry (vrfid, family, force, type, nrn); + if (nrn) route_unlock_node (nrn); } @@ -735,6 +754,13 @@ zebra_evaluate_rnh (vrf_id_t vrfid, int family, int force, rnh_type_t type, zebra_rnh_evaluate_entry (vrfid, family, force, type, nrn); nrn = route_next(nrn); /* this will also unlock nrn */ } + nrn = route_top (rnh_table); + while (nrn) + { + if (nrn->info) + zebra_rnh_clear_nhc_flag (vrfid, family, type, nrn); + nrn = route_next(nrn); /* this will also unlock nrn */ + } } } |
