summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2016-06-14 20:07:09 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-21 02:28:26 +0200
commitce01a2ca3f4501b75e55fe325c150eb9c2ae329d (patch)
tree83354527a0bb7d2f8dea8eabd2632c27276b09d0 /vtysh
parentripd: print md5 auth digest correctly (diff)
downloadfrr-ce01a2ca3f4501b75e55fe325c150eb9c2ae329d.tar.xz
frr-ce01a2ca3f4501b75e55fe325c150eb9c2ae329d.zip
vtysh: handle case if there is no match in "write terminal $daemon"
While the DEFUN should match the list of clients registered in vtysh, it seems better to handle the case explicitly instead of relying on the client list and the DEFUN signature being in sync. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 4b579ddbd..a5e146c94 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -2409,6 +2409,9 @@ DEFUN (vtysh_write_terminal_daemon,
break;
}
+ if (i == array_size(vtysh_client))
+ return CMD_ERR_NO_MATCH;
+
ret = vtysh_client_execute(&vtysh_client[i], "show running-config\n", stdout);
return ret;