summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-07-13 11:19:00 +0200
committerMaria Matejka <mq@ucw.cz>2022-07-13 11:24:09 +0200
commit4ec443b5c283fc4f37629bc38ef3730e0a7cc932 (patch)
treeaa3258caf6c77ec94ddf30a7feb67559d2eeb485
parent4f16270dd91df68410760edad3fa7a1ecfc1c35b (diff)
Fixed bug in repeated show route command
Introduced by 13ef5e53dd4a98c80261139b4c9ce4b1074cac40, the CLI was not properly cleaned up when the command finished, causing BIRD to not parse any other command after "show route".
-rw-r--r--nest/rt-show.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/nest/rt-show.c b/nest/rt-show.c
index dd0fe595..1dbfaec2 100644
--- a/nest/rt-show.c
+++ b/nest/rt-show.c
@@ -260,6 +260,18 @@ rt_show_dump_req(struct rt_export_request *req)
}
static void
+rt_show_done(struct rt_show_data *d)
+{
+ /* No more action */
+ d->cli->cleanup = NULL;
+ d->cli->cont = NULL;
+ d->cli->rover = NULL;
+
+ /* Write pending messages */
+ cli_write_trigger(d->cli);
+}
+
+static void
rt_show_cont(struct rt_show_data *d)
{
struct cli *c = d->cli;
@@ -267,13 +279,7 @@ rt_show_cont(struct rt_show_data *d)
if (d->running_on_config && (d->running_on_config != config))
{
cli_printf(c, 8004, "Stopped due to reconfiguration");
-
- /* No more action */
- c->cleanup = NULL;
- c->cont = NULL;
- c->rover = NULL;
- cli_write_trigger(c);
- return;
+ return rt_show_done(d);
}
d->req = (struct rt_export_request) {
@@ -320,7 +326,6 @@ rt_show_export_stopped(struct rt_export_request *req)
if (NODE_VALID(d->tab))
return rt_show_cont(d);
-
/* Printout total stats */
if (d->stats && (d->table_counter > 1))
{
@@ -333,7 +338,8 @@ rt_show_export_stopped(struct rt_export_request *req)
else
cli_printf(d->cli, 0, "");
- cli_write_trigger(d->cli);
+ /* No more route showing */
+ rt_show_done(d);
}
struct rt_show_data_rtable *