diff options
author | Maria Matejka <mq@ucw.cz> | 2022-07-12 12:40:18 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-07-12 14:45:27 +0200 |
commit | bc2ce4aaa8d1e4d56776ee35352c5e2caa09a0e5 (patch) | |
tree | 95c9224efba38da51c3464810a7007f8d70a4e3d /nest/rt-table.c | |
parent | 080cbd1219ba86dd44712d0d24ceae884b34ec4b (diff) |
Removing the rte_modify API
For BGP LLGR purposes, there was an API allowing a protocol to directly
modify their stale routes in table before flushing them. This API was
called by the table prune routine which violates the future locking
requirements.
Instead of this, BGP now requests a special route export and reimports
these routes into the table, allowing for asynchronous execution without
locking the table on export.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r-- | nest/rt-table.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c index 2ba28e33..50ddc141 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1322,8 +1322,6 @@ rte_recalculate(struct rt_import_hook *c, net *net, rte *new, struct rte_src *sr if (new && rte_same(old, &new_stored->rte)) { /* No changes, ignore the new route and refresh the old one */ - - old->flags &= ~REF_MODIFY; old->stale_cycle = new->stale_cycle; if (!rte_is_filtered(new)) @@ -1673,24 +1671,6 @@ rte_discard(net *net, rte *old) /* Non-filtered route deletion, used during garb rte_update_unlock(); } -/* Modify existing route by protocol hook, used for long-lived graceful restart */ -static inline void -rte_modify(net *net, rte *old) -{ - rte_update_lock(); - - rte *new = old->sender->req->rte_modify(old, rte_update_pool); - if (new != old) - { - if (new) - new->flags = old->flags & ~REF_MODIFY; - - rte_recalculate(old->sender, net, new, old->src); - } - - rte_update_unlock(); -} - /* Check rtable for best route to given net whether it would be exported do p */ int rt_examine(rtable *t, net_addr *a, struct channel *c, const struct filter *filter) @@ -1977,29 +1957,6 @@ rt_refresh_end(struct rt_import_request *req) log(L_TRACE "%s: route refresh end [%u]", req->name, hook->stale_valid); } -void -rt_modify_stale(rtable *t, struct rt_import_request *req) -{ - int prune = 0; - struct rt_import_hook *s = req->hook; - - FIB_WALK(&t->fib, net, n) - { - for (struct rte_storage *e = n->routes; e; e = e->next) - if ((e->rte.sender == s) && - !(e->rte.flags & REF_FILTERED) && - (e->rte.stale_cycle + 1 == s->stale_set)) - { - e->rte.flags |= REF_MODIFY; - prune = 1; - } - } - FIB_WALK_END; - - if (prune) - rt_schedule_prune(t); -} - /** * rte_dump - dump a route * @e: &rte to be dumped @@ -2501,14 +2458,6 @@ again: goto rescan; } - - if (e->rte.flags & REF_MODIFY) - { - rte_modify(n, &e->rte); - limit--; - - goto rescan; - } } if (!n->routes) /* Orphaned FIB entry */ |