Preexisting code to detect commands targeted at wrong instance didn't
work because a command applied to a disconnected vtysh_client counted as
a successful run overriding wrong instance error message
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
wrong_instance++;
continue;
}
- correct_instance++;
+ if (client->fd > 0)
+ correct_instance++;
if (rc != CMD_SUCCESS) {
if (!continue_on_err)
return rc;
vc = vc->next)
any_inst = any_inst
|| (vc->fd > 0);
- if (!any_inst)
+ if (!any_inst) {
fprintf(stderr,
"%s is not running\n",
vtysh_client[i].name);
- continue;
+ continue;
+ }
}
cmd_stat = vtysh_client_execute(
&vtysh_client[i], line, fp);