summaryrefslogtreecommitdiff
path: root/nest/cli.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-06-24 15:27:26 +0200
committerMaria Matejka <mq@ucw.cz>2022-06-27 12:32:47 +0200
commit13ef5e53dd4a98c80261139b4c9ce4b1074cac40 (patch)
tree8508b9b004747a55b5d53fac22b29ce5f6977f57 /nest/cli.c
parent5c1ebe012e1bbfec52b4fba8b59edd355a7dff91 (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/cli.c')
-rw-r--r--nest/cli.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/nest/cli.c b/nest/cli.c
index b54a0d76..31deef03 100644
--- a/nest/cli.c
+++ b/nest/cli.c
@@ -319,7 +319,6 @@ cli_new(void *priv)
c->event->data = c;
c->cont = cli_hello;
c->parser_pool = lp_new_default(c->pool);
- c->show_pool = lp_new_default(c->pool);
c->rx_buf = mb_alloc(c->pool, CLI_RX_BUF_SIZE);
ev_schedule(c->event);
return c;
@@ -409,11 +408,14 @@ void
cli_free(cli *c)
{
cli_set_log_echo(c, 0, 0);
+ int defer = 0;
if (c->cleanup)
- c->cleanup(c);
+ defer = c->cleanup(c);
if (c == cmd_reconfig_stored_cli)
cmd_reconfig_stored_cli = NULL;
- rfree(c->pool);
+
+ if (!defer)
+ rfree(c->pool);
}
/**