diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index cd78551cb4..f57a4d9ddf 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -577,7 +577,7 @@ static int vtysh_execute_func(const char *line, int pager) && (cmd->daemon == vtysh_client[i].flag)) { for (vc = &vtysh_client[i]; vc; vc = vc->next) - if (vc->fd < 0) + if (vc->fd == VTYSH_WAS_ACTIVE) vtysh_reconnect(vc); } if (vtysh_client[i].fd < 0