summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/command.c3
-rw-r--r--pathd/path_pcep_cli.c6
-rw-r--r--vtysh/vtysh.c33
3 files changed, 36 insertions, 6 deletions
diff --git a/lib/command.c b/lib/command.c
index 9dac60599c..fe17c68a8b 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -160,6 +160,9 @@ static bool vty_check_node_for_xpath_decrement(enum node_type target_node,
|| node == BGP_FLOWSPECV6_NODE))
return false;
+ if (target_node == INTERFACE_NODE && node == LINK_PARAMS_NODE)
+ return false;
+
return true;
}
diff --git a/pathd/path_pcep_cli.c b/pathd/path_pcep_cli.c
index 2e4e331ad9..a911210ab4 100644
--- a/pathd/path_pcep_cli.c
+++ b/pathd/path_pcep_cli.c
@@ -505,7 +505,7 @@ static int path_pcep_cli_show_srte_pcep_counters(struct vty *vty)
{
int i, j, row;
time_t diff_time;
- struct tm *tm_info;
+ struct tm tm_info;
char tm_buffer[26];
struct counters_group *group;
struct counters_subgroup *subgroup;
@@ -522,8 +522,8 @@ static int path_pcep_cli_show_srte_pcep_counters(struct vty *vty)
}
diff_time = time(NULL) - group->start_time;
- tm_info = localtime(&group->start_time);
- strftime(tm_buffer, sizeof(tm_buffer), "%Y-%m-%d %H:%M:%S", tm_info);
+ localtime_r(&group->start_time, &tm_info);
+ strftime(tm_buffer, sizeof(tm_buffer), "%Y-%m-%d %H:%M:%S", &tm_info);
vty_out(vty, "PCEP counters since %s (%uh %um %us):\n", tm_buffer,
(uint32_t)(diff_time / 3600), (uint32_t)((diff_time / 60) % 60),
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index dd3f448674..0bc2c6ebd0 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -2803,6 +2803,18 @@ DEFUNSH(VTYSH_INTERFACE, vtysh_quit_interface, vtysh_quit_interface_cmd, "quit",
return vtysh_exit_interface(self, vty, argc, argv);
}
+DEFUNSH(VTYSH_ZEBRA, vtysh_exit_pseudowire, vtysh_exit_pseudowire_cmd, "exit",
+ "Exit current mode and down to previous mode\n")
+{
+ return vtysh_exit(vty);
+}
+
+DEFUNSH(VTYSH_ZEBRA, vtysh_quit_pseudowire, vtysh_quit_pseudowire_cmd, "quit",
+ "Exit current mode and down to previous mode\n")
+{
+ return vtysh_exit_pseudowire(self, vty, argc, argv);
+}
+
static char *do_prepend(struct vty *vty, struct cmd_token **argv, int argc)
{
const char *argstr[argc + 1];
@@ -2907,6 +2919,20 @@ DEFUNSH(VTYSH_ZEBRA, exit_link_params, exit_link_params_cmd, "exit-link-params",
return CMD_SUCCESS;
}
+DEFUNSH(VTYSH_ZEBRA, vtysh_exit_link_params, vtysh_exit_link_params_cmd, "exit",
+ "Exit current mode and down to previous mode\n")
+{
+ if (vty->node == LINK_PARAMS_NODE)
+ vty->node = INTERFACE_NODE;
+ return CMD_SUCCESS;
+}
+
+DEFUNSH(VTYSH_ZEBRA, vtysh_quit_link_params, vtysh_quit_link_params_cmd, "quit",
+ "Exit current mode and down to previous mode\n")
+{
+ return vtysh_exit_link_params(self, vty, argc, argv);
+}
+
DEFUNSH_HIDDEN (0x00,
vtysh_debug_all,
vtysh_debug_all_cmd,
@@ -4445,13 +4471,14 @@ void vtysh_init_vty(void)
install_element(INTERFACE_NODE, &vtysh_link_params_cmd);
install_element(LINK_PARAMS_NODE, &exit_link_params_cmd);
install_element(LINK_PARAMS_NODE, &vtysh_end_all_cmd);
- install_element(LINK_PARAMS_NODE, &vtysh_exit_interface_cmd);
+ install_element(LINK_PARAMS_NODE, &vtysh_exit_link_params_cmd);
+ install_element(LINK_PARAMS_NODE, &vtysh_quit_link_params_cmd);
install_node(&pw_node);
install_element(CONFIG_NODE, &vtysh_pseudowire_cmd);
install_element(PW_NODE, &vtysh_end_all_cmd);
- install_element(PW_NODE, &vtysh_exit_interface_cmd);
- install_element(PW_NODE, &vtysh_quit_interface_cmd);
+ install_element(PW_NODE, &vtysh_exit_pseudowire_cmd);
+ install_element(PW_NODE, &vtysh_quit_pseudowire_cmd);
install_node(&vrf_node);
install_element(CONFIG_NODE, &vtysh_vrf_cmd);