mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 03:28:31 +00:00
Merge pull request #3632 from opensourcerouting/cli-xpath-fixes
Fix CLI issue introduced by the northbound + simplifications
This commit is contained in:
commit
d45a375af2
@ -1535,67 +1535,11 @@ DEFUN (config_end,
|
|||||||
"end",
|
"end",
|
||||||
"End current mode and change to enable mode.\n")
|
"End current mode and change to enable mode.\n")
|
||||||
{
|
{
|
||||||
switch (vty->node) {
|
if (vty->config) {
|
||||||
case VIEW_NODE:
|
|
||||||
case ENABLE_NODE:
|
|
||||||
/* Nothing to do. */
|
|
||||||
break;
|
|
||||||
case CONFIG_NODE:
|
|
||||||
case INTERFACE_NODE:
|
|
||||||
case PW_NODE:
|
|
||||||
case LOGICALROUTER_NODE:
|
|
||||||
case VRF_NODE:
|
|
||||||
case NH_GROUP_NODE:
|
|
||||||
case ZEBRA_NODE:
|
|
||||||
case RIP_NODE:
|
|
||||||
case RIPNG_NODE:
|
|
||||||
case EIGRP_NODE:
|
|
||||||
case BABEL_NODE:
|
|
||||||
case BGP_NODE:
|
|
||||||
case BGP_VRF_POLICY_NODE:
|
|
||||||
case BGP_VNC_DEFAULTS_NODE:
|
|
||||||
case BGP_VNC_NVE_GROUP_NODE:
|
|
||||||
case BGP_VNC_L2_GROUP_NODE:
|
|
||||||
case BGP_VPNV4_NODE:
|
|
||||||
case BGP_VPNV6_NODE:
|
|
||||||
case BGP_FLOWSPECV4_NODE:
|
|
||||||
case BGP_FLOWSPECV6_NODE:
|
|
||||||
case BGP_IPV4_NODE:
|
|
||||||
case BGP_IPV4M_NODE:
|
|
||||||
case BGP_IPV4L_NODE:
|
|
||||||
case BGP_IPV6_NODE:
|
|
||||||
case BGP_IPV6M_NODE:
|
|
||||||
case BGP_EVPN_NODE:
|
|
||||||
case BGP_EVPN_VNI_NODE:
|
|
||||||
case BGP_IPV6L_NODE:
|
|
||||||
case RMAP_NODE:
|
|
||||||
case PBRMAP_NODE:
|
|
||||||
case OSPF_NODE:
|
|
||||||
case OSPF6_NODE:
|
|
||||||
case LDP_NODE:
|
|
||||||
case LDP_IPV4_NODE:
|
|
||||||
case LDP_IPV6_NODE:
|
|
||||||
case LDP_IPV4_IFACE_NODE:
|
|
||||||
case LDP_IPV6_IFACE_NODE:
|
|
||||||
case LDP_L2VPN_NODE:
|
|
||||||
case LDP_PSEUDOWIRE_NODE:
|
|
||||||
case ISIS_NODE:
|
|
||||||
case OPENFABRIC_NODE:
|
|
||||||
case KEYCHAIN_NODE:
|
|
||||||
case KEYCHAIN_KEY_NODE:
|
|
||||||
case VTY_NODE:
|
|
||||||
case LINK_PARAMS_NODE:
|
|
||||||
case BFD_NODE:
|
|
||||||
case BFD_PEER_NODE:
|
|
||||||
vty_config_exit(vty);
|
vty_config_exit(vty);
|
||||||
vty->node = ENABLE_NODE;
|
vty->node = ENABLE_NODE;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vty->xpath_index = 0;
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
92
lib/vty.c
92
lib/vty.c
@ -775,61 +775,11 @@ static void vty_end_config(struct vty *vty)
|
|||||||
{
|
{
|
||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
|
|
||||||
switch (vty->node) {
|
if (vty->config) {
|
||||||
case VIEW_NODE:
|
|
||||||
case ENABLE_NODE:
|
|
||||||
/* Nothing to do. */
|
|
||||||
break;
|
|
||||||
case CONFIG_NODE:
|
|
||||||
case INTERFACE_NODE:
|
|
||||||
case PW_NODE:
|
|
||||||
case ZEBRA_NODE:
|
|
||||||
case RIP_NODE:
|
|
||||||
case RIPNG_NODE:
|
|
||||||
case EIGRP_NODE:
|
|
||||||
case BGP_NODE:
|
|
||||||
case BGP_VPNV4_NODE:
|
|
||||||
case BGP_VPNV6_NODE:
|
|
||||||
case BGP_VRF_POLICY_NODE:
|
|
||||||
case BGP_VNC_DEFAULTS_NODE:
|
|
||||||
case BGP_VNC_NVE_GROUP_NODE:
|
|
||||||
case BGP_VNC_L2_GROUP_NODE:
|
|
||||||
case BGP_IPV4_NODE:
|
|
||||||
case BGP_IPV4M_NODE:
|
|
||||||
case BGP_IPV4L_NODE:
|
|
||||||
case BGP_IPV6_NODE:
|
|
||||||
case BGP_IPV6M_NODE:
|
|
||||||
case BGP_EVPN_NODE:
|
|
||||||
case BGP_IPV6L_NODE:
|
|
||||||
case RMAP_NODE:
|
|
||||||
case PBRMAP_NODE:
|
|
||||||
case OSPF_NODE:
|
|
||||||
case OSPF6_NODE:
|
|
||||||
case LDP_NODE:
|
|
||||||
case LDP_IPV4_NODE:
|
|
||||||
case LDP_IPV6_NODE:
|
|
||||||
case LDP_IPV4_IFACE_NODE:
|
|
||||||
case LDP_IPV6_IFACE_NODE:
|
|
||||||
case LDP_L2VPN_NODE:
|
|
||||||
case LDP_PSEUDOWIRE_NODE:
|
|
||||||
case ISIS_NODE:
|
|
||||||
case OPENFABRIC_NODE:
|
|
||||||
case KEYCHAIN_NODE:
|
|
||||||
case KEYCHAIN_KEY_NODE:
|
|
||||||
case VTY_NODE:
|
|
||||||
case BGP_EVPN_VNI_NODE:
|
|
||||||
case BFD_NODE:
|
|
||||||
case BFD_PEER_NODE:
|
|
||||||
vty_config_exit(vty);
|
vty_config_exit(vty);
|
||||||
vty->node = ENABLE_NODE;
|
vty->node = ENABLE_NODE;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* Unknown node, we have to ignore it. */
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vty->xpath_index = 0;
|
|
||||||
|
|
||||||
vty_prompt(vty);
|
vty_prompt(vty);
|
||||||
vty->cp = 0;
|
vty->cp = 0;
|
||||||
}
|
}
|
||||||
@ -1190,44 +1140,11 @@ static void vty_stop_input(struct vty *vty)
|
|||||||
vty_clear_buf(vty);
|
vty_clear_buf(vty);
|
||||||
vty_out(vty, "\n");
|
vty_out(vty, "\n");
|
||||||
|
|
||||||
switch (vty->node) {
|
if (vty->config) {
|
||||||
case VIEW_NODE:
|
|
||||||
case ENABLE_NODE:
|
|
||||||
/* Nothing to do. */
|
|
||||||
break;
|
|
||||||
case CONFIG_NODE:
|
|
||||||
case INTERFACE_NODE:
|
|
||||||
case PW_NODE:
|
|
||||||
case ZEBRA_NODE:
|
|
||||||
case RIP_NODE:
|
|
||||||
case RIPNG_NODE:
|
|
||||||
case EIGRP_NODE:
|
|
||||||
case BGP_NODE:
|
|
||||||
case RMAP_NODE:
|
|
||||||
case PBRMAP_NODE:
|
|
||||||
case OSPF_NODE:
|
|
||||||
case OSPF6_NODE:
|
|
||||||
case LDP_NODE:
|
|
||||||
case LDP_IPV4_NODE:
|
|
||||||
case LDP_IPV6_NODE:
|
|
||||||
case LDP_IPV4_IFACE_NODE:
|
|
||||||
case LDP_IPV6_IFACE_NODE:
|
|
||||||
case LDP_L2VPN_NODE:
|
|
||||||
case LDP_PSEUDOWIRE_NODE:
|
|
||||||
case ISIS_NODE:
|
|
||||||
case OPENFABRIC_NODE:
|
|
||||||
case KEYCHAIN_NODE:
|
|
||||||
case KEYCHAIN_KEY_NODE:
|
|
||||||
case VTY_NODE:
|
|
||||||
case BFD_NODE:
|
|
||||||
case BFD_PEER_NODE:
|
|
||||||
vty_config_exit(vty);
|
vty_config_exit(vty);
|
||||||
vty->node = ENABLE_NODE;
|
vty->node = ENABLE_NODE;
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* Unknown node, we have to ignore it. */
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vty_prompt(vty);
|
vty_prompt(vty);
|
||||||
|
|
||||||
/* Set history pointer to the latest one. */
|
/* Set history pointer to the latest one. */
|
||||||
@ -2696,6 +2613,7 @@ int vty_config_enter(struct vty *vty, bool private_config, bool exclusive)
|
|||||||
vty->node = CONFIG_NODE;
|
vty->node = CONFIG_NODE;
|
||||||
vty->config = true;
|
vty->config = true;
|
||||||
vty->private_config = private_config;
|
vty->private_config = private_config;
|
||||||
|
vty->xpath_index = 0;
|
||||||
|
|
||||||
if (private_config) {
|
if (private_config) {
|
||||||
vty->candidate_config = nb_config_dup(running_config);
|
vty->candidate_config = nb_config_dup(running_config);
|
||||||
@ -2733,6 +2651,8 @@ void vty_config_exit(struct vty *vty)
|
|||||||
nb_config_free(vty->candidate_config_base);
|
nb_config_free(vty->candidate_config_base);
|
||||||
vty->candidate_config_base = NULL;
|
vty->candidate_config_base = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vty->config = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int vty_config_exclusive_lock(struct vty *vty)
|
int vty_config_exclusive_lock(struct vty *vty)
|
||||||
|
Loading…
Reference in New Issue
Block a user