bgpd: disambiguate differet forms of

show bgp ipv4 vpn
      address-family ipv4&6 vpn

Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
Lou Berger 2017-01-22 20:51:12 -05:00
parent 28070ee3c4
commit b99615f95f
2 changed files with 6 additions and 6 deletions

View File

@ -953,7 +953,7 @@ bgp_show_mpls_vpn (struct vty *vty, afi_t afi, struct prefix_rd *prd,
DEFUN (show_bgp_ip_vpn_rd,
show_bgp_ip_vpn_rd_cmd,
"show [ip] bgp "BGP_AFI_CMD_STR" vpn [rd ASN:nn_or_IP-address:nn] [json]",
"show bgp "BGP_AFI_CMD_STR" vpn all [rd ASN:nn_or_IP-address:nn] [json]",
SHOW_STR
IP_STR
BGP_STR
@ -963,7 +963,7 @@ DEFUN (show_bgp_ip_vpn_rd,
"VPN Route Distinguisher\n"
JSON_STR)
{
int idx_ext_community = 5;
int idx_rd = 5;
int ret;
struct prefix_rd prd;
afi_t afi;
@ -971,9 +971,9 @@ DEFUN (show_bgp_ip_vpn_rd,
if (argv_find_and_parse_afi (argv, argc, &idx, &afi))
{
if (argv[idx_ext_community]->arg)
if (argc >= 7 && argv[idx_rd]->arg)
{
ret = str2prefix_rd (argv[idx_ext_community]->arg, &prd);
ret = str2prefix_rd (argv[idx_rd]->arg, &prd);
if (! ret)
{
vty_out (vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);

View File

@ -5586,7 +5586,6 @@ DEFUN (address_family_vpnv6,
vty->node = BGP_VPNV6_NODE;
return CMD_SUCCESS;
}
#endif /* KEEP_OLD_VPN_COMMANDS */
DEFUN (address_family_ipv4_vpn,
address_family_ipv4_vpn_cmd,
@ -5609,6 +5608,7 @@ DEFUN (address_family_ipv6_vpn,
vty->node = BGP_VPNV6_NODE;
return CMD_SUCCESS;
}
#endif /* KEEP_OLD_VPN_COMMANDS */
DEFUN (address_family_encap,
address_family_encap_cmd,
@ -10716,9 +10716,9 @@ bgp_vty_init (void)
#ifdef KEEP_OLD_VPN_COMMANDS
install_element (BGP_NODE, &address_family_vpnv4_cmd);
install_element (BGP_NODE, &address_family_vpnv6_cmd);
#endif /* KEEP_OLD_VPN_COMMANDS */
install_element (BGP_NODE, &address_family_ipv4_vpn_cmd);
install_element (BGP_NODE, &address_family_ipv6_vpn_cmd);
#endif /* KEEP_OLD_VPN_COMMANDS */
install_element (BGP_NODE, &address_family_encap_cmd);
install_element (BGP_NODE, &address_family_encapv6_cmd);