diff options
author | Maria Matejka <mq@ucw.cz> | 2022-06-24 15:27:26 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-06-27 12:32:47 +0200 |
commit | 13ef5e53dd4a98c80261139b4c9ce4b1074cac40 (patch) | |
tree | 8508b9b004747a55b5d53fac22b29ce5f6977f57 /nest/rt-table.c | |
parent | 5c1ebe012e1bbfec52b4fba8b59edd355a7dff91 (diff) |
The show-route CLI command now uses the route export API
In the multithreaded environment, it is not supposed that anybody
traverses the routing table as the CLI show-route was doing. Now the
routing table traversal is gone and CLI won't hold the table locked
while computing filters.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r-- | nest/rt-table.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c index afafef62..ed0132ca 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1813,7 +1813,16 @@ rt_table_export_stop(struct rt_export_hook *hook) rtable *tab = SKIP_BACK(rtable, exporter, hook->table); if (hook->export_state == TES_FEEDING) - fit_get(&tab->fib, &hook->feed_fit); + if (hook->walk_lock) + { + rt_unlock_trie(tab, hook->walk_lock); + hook->walk_lock = NULL; + + mb_free(hook->walk_state); + hook->walk_state = NULL; + } + else + fit_get(&tab->fib, &hook->feed_fit); } void |