]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: allow 'do' commands in ENABLE_NODE 718/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 14 Jun 2017 19:47:14 +0000 (19:47 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 16 Jun 2017 14:46:08 +0000 (14:46 +0000)
'do' is syntax sugar that allows the user to execute a command under
ENABLE_NODE when in another CLI node. If the user is already in
ENABLE_NODE, use of 'do' was previously disallowed. This patch allows it
because it makes it easier for us to hack around certain instances of
the node synchronization problem with vtysh.

Also included is a fix for one of these problems.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/command.c
vtysh/vtysh.c

index 8a4250bce5f9763f1f6bc46548520aa429a067cc..585371099981692f9e2a6316a8a66d086ea8b20e 100644 (file)
@@ -534,7 +534,6 @@ cmd_try_do_shortcut (enum node_type node, char* first_word) {
        node != AUTH_NODE &&
        node != VIEW_NODE &&
        node != AUTH_ENABLE_NODE &&
-       node != ENABLE_NODE &&
        0 == strcmp( "do", first_word ) )
     return 1;
   return 0;
index 30168a2d982f1b528dc13e9584ad0d429667a3ea..ffdfd5d7254172ed7294fb6609f772658826e3c2 100644 (file)
@@ -2588,7 +2588,7 @@ int
 vtysh_write_config_integrated(void)
 {
   u_int i;
-  char line[] = "write terminal\n";
+  char line[] = "do write terminal\n";
   FILE *fp;
   int fd;
   struct passwd *pwentry;
@@ -2713,7 +2713,7 @@ DEFUN (vtysh_write_memory,
         if (vtysh_client[i].flag == VTYSH_WATCHFRR)
           break;
       if (i < array_size(vtysh_client) && vtysh_client[i].fd != -1)
-        ret = vtysh_client_execute (&vtysh_client[i], "write integrated", stdout);
+        ret = vtysh_client_execute (&vtysh_client[i], "do write integrated", stdout);
 
       if (ret != CMD_SUCCESS)
         {