0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-19 01:28:44 +00:00

Fixed bug in repeated show route command

Introduced by 13ef5e53dd, the CLI was not
properly cleaned up when the command finished, causing BIRD to not parse
any other command after "show route".
This commit is contained in:
Maria Matejka 2022-07-13 11:19:00 +02:00
parent 4f16270dd9
commit 4ec443b5c2

View File

@ -259,6 +259,18 @@ rt_show_dump_req(struct rt_export_request *req)
debug(" CLI Show Route Feed %p\n", req); debug(" CLI Show Route Feed %p\n", 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 static void
rt_show_cont(struct rt_show_data *d) rt_show_cont(struct rt_show_data *d)
{ {
@ -267,13 +279,7 @@ rt_show_cont(struct rt_show_data *d)
if (d->running_on_config && (d->running_on_config != config)) if (d->running_on_config && (d->running_on_config != config))
{ {
cli_printf(c, 8004, "Stopped due to reconfiguration"); cli_printf(c, 8004, "Stopped due to reconfiguration");
return rt_show_done(d);
/* No more action */
c->cleanup = NULL;
c->cont = NULL;
c->rover = NULL;
cli_write_trigger(c);
return;
} }
d->req = (struct rt_export_request) { d->req = (struct rt_export_request) {
@ -320,7 +326,6 @@ rt_show_export_stopped(struct rt_export_request *req)
if (NODE_VALID(d->tab)) if (NODE_VALID(d->tab))
return rt_show_cont(d); return rt_show_cont(d);
/* Printout total stats */ /* Printout total stats */
if (d->stats && (d->table_counter > 1)) if (d->stats && (d->table_counter > 1))
{ {
@ -333,7 +338,8 @@ rt_show_export_stopped(struct rt_export_request *req)
else else
cli_printf(d->cli, 0, ""); cli_printf(d->cli, 0, "");
cli_write_trigger(d->cli); /* No more route showing */
rt_show_done(d);
} }
struct rt_show_data_rtable * struct rt_show_data_rtable *