diff options
| author | Mark Stapp <mjs@voltanet.io> | 2019-08-14 13:30:24 -0400 |
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2019-09-12 08:51:05 -0400 |
| commit | 40f321c000862f9d25f29c6003c53f21997bba80 (patch) | |
| tree | 301e3fbda24134458c8b2d0bb57b91fb660aaf20 /zebra/zebra_rib.c | |
| parent | e6dafed0e261c6582d81d4c9d8f2e4844aff4448 (diff) | |
zebra: revise redistribution delete to improve update case
When selecting a new best route, zebra sends a redist update
when the route is installed. There are cases where redist
clients may not see that redist add - clients who are not
subscribed to the new route type, e.g. In that case, attempt
to send a redist delete for the old/previous route type.
Revised the redist delete api to accomodate both cases;
also tightened up the const-ness of a few internal redist apis.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 157c67fa62..ff4bfb10f7 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -691,7 +691,7 @@ static void rib_uninstall(struct route_node *rn, struct route_entry *re) srcdest_rnode_prefixes(rn, &p, &src_p); - redistribute_delete(p, src_p, re); + redistribute_delete(p, src_p, re, NULL); UNSET_FLAG(re->flags, ZEBRA_FLAG_SELECTED); } } @@ -1248,8 +1248,17 @@ static void rib_process(struct route_node *rn) SET_FLAG(new_selected->flags, ZEBRA_FLAG_SELECTED); if (old_selected) { - if (!new_selected) - redistribute_delete(p, src_p, old_selected); + /* + * If we're removing the old entry, we should tell + * redist subscribers about that *if* they aren't + * going to see a redist for the new entry. + */ + if (!new_selected || CHECK_FLAG(old_selected->status, + ROUTE_ENTRY_REMOVED)) + redistribute_delete(p, src_p, + old_selected, + new_selected); + if (old_selected != new_selected) UNSET_FLAG(old_selected->flags, ZEBRA_FLAG_SELECTED); @@ -2026,7 +2035,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx) dplane_route_notif_update(rn, re, DPLANE_OP_ROUTE_DELETE, ctx); /* Redistribute, lsp, and nht update */ - redistribute_delete(dest_pfx, src_pfx, re); + redistribute_delete(dest_pfx, src_pfx, re, NULL); zebra_rib_evaluate_rn_nexthops( rn, zebra_router_get_next_sequence()); |
