mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 11:18:59 +00:00
bgpd: fix rpki exit command
If a command returns a nonzero exit status and VTYSH has a corresponding command, VTYSH will skip executing its own version. If this happens in a command that changes CLI nodes we get node desynchronization. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
ff7f6cd829
commit
61a484a90a
@ -1210,10 +1210,10 @@ DEFUN_NOSH (rpki_exit,
|
|||||||
"exit",
|
"exit",
|
||||||
"Exit rpki configuration and restart rpki session\n")
|
"Exit rpki configuration and restart rpki session\n")
|
||||||
{
|
{
|
||||||
int ret = reset(false);
|
reset(false);
|
||||||
|
|
||||||
vty->node = CONFIG_NODE;
|
vty->node = CONFIG_NODE;
|
||||||
return ret == SUCCESS ? CMD_SUCCESS : CMD_WARNING;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN_NOSH (rpki_quit,
|
DEFUN_NOSH (rpki_quit,
|
||||||
|
@ -1435,24 +1435,6 @@ DEFUNSH(VTYSH_BGPD,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUNSH(VTYSH_BGPD,
|
|
||||||
rpki_exit,
|
|
||||||
rpki_exit_cmd,
|
|
||||||
"exit",
|
|
||||||
"Exit current mode and down to previous mode\n")
|
|
||||||
{
|
|
||||||
vty->node = CONFIG_NODE;
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUNSH(VTYSH_BGPD,
|
|
||||||
rpki_quit,
|
|
||||||
rpki_quit_cmd,
|
|
||||||
"quit",
|
|
||||||
"Exit current mode and down to previous mode\n")
|
|
||||||
{
|
|
||||||
return rpki_exit(self, vty, argc, argv);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEFUNSH(VTYSH_BGPD, address_family_evpn, address_family_evpn_cmd,
|
DEFUNSH(VTYSH_BGPD, address_family_evpn, address_family_evpn_cmd,
|
||||||
@ -1790,6 +1772,7 @@ static int vtysh_exit(struct vty *vty)
|
|||||||
case VTY_NODE:
|
case VTY_NODE:
|
||||||
case KEYCHAIN_NODE:
|
case KEYCHAIN_NODE:
|
||||||
case BFD_NODE:
|
case BFD_NODE:
|
||||||
|
case RPKI_NODE:
|
||||||
vtysh_execute("end");
|
vtysh_execute("end");
|
||||||
vtysh_execute("configure terminal");
|
vtysh_execute("configure terminal");
|
||||||
vty->node = CONFIG_NODE;
|
vty->node = CONFIG_NODE;
|
||||||
@ -1883,8 +1866,24 @@ DEFUNSH(VTYSH_BGPD, exit_vnc_config, exit_vnc_config_cmd, "exit-vnc",
|
|||||||
|| vty->node == BGP_VNC_L2_GROUP_NODE)
|
|| vty->node == BGP_VNC_L2_GROUP_NODE)
|
||||||
vty->node = BGP_NODE;
|
vty->node = BGP_NODE;
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_RPKI)
|
||||||
|
DEFUNSH(VTYSH_BGPD, rpki_exit, rpki_exit_cmd, "exit",
|
||||||
|
"Exit current mode and down to previous mode\n")
|
||||||
|
{
|
||||||
|
vtysh_exit(vty);
|
||||||
|
return CMD_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFUNSH(VTYSH_BGPD, rpki_quit, rpki_quit_cmd, "quit",
|
||||||
|
"Exit current mode and down to previous mode\n")
|
||||||
|
{
|
||||||
|
return rpki_exit(self, vty, argc, argv);
|
||||||
|
}
|
||||||
|
#endif /* HAVE_RPKI */
|
||||||
|
|
||||||
DEFUNSH(VTYSH_PIMD|VTYSH_ZEBRA, exit_vrf_config, exit_vrf_config_cmd, "exit-vrf",
|
DEFUNSH(VTYSH_PIMD|VTYSH_ZEBRA, exit_vrf_config, exit_vrf_config_cmd, "exit-vrf",
|
||||||
"Exit from VRF configuration mode\n")
|
"Exit from VRF configuration mode\n")
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user