Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master version of basic vrf commands & some other missed fixes #101

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bgpd/bgp_mplsvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,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
Expand All @@ -979,17 +979,17 @@ 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;
int idx = 0;

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);
Expand Down
8 changes: 7 additions & 1 deletion bgpd/bgp_mplsvpn.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA

#define RD_ADDRSTRLEN 28

#ifdef MPLS_LABEL_MAX
# undef MPLS_LABEL_MAX
#endif

typedef enum {
MPLS_LABEL_IPV4_EXPLICIT_NULL = 0, /* [RFC3032] */
MPLS_LABEL_ROUTER_ALERT = 1, /* [RFC3032] */
Expand All @@ -45,7 +49,9 @@ typedef enum {
MPLS_LABEL_UNASSIGNED11 = 11,
MPLS_LABEL_GAL = 13, /* [RFC5586] */
MPLS_LABEL_OAM_ALERT = 14, /* [RFC3429] */
MPLS_LABEL_EXTENSION = 15 /* [RFC7274] */
MPLS_LABEL_EXTENSION = 15, /* [RFC7274] */
MPLS_LABEL_MAX = 1048575,
MPLS_LABEL_ILLEGAL = 0xFFFFFFFF /* for internal use only */
} mpls_special_label_t;

#define MPLS_LABEL_IS_SPECIAL(label) \
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -9441,7 +9441,7 @@ peer_adj_routes (struct vty *vty, struct peer *peer, afi_t afi, safi_t safi,

DEFUN (show_ip_bgp_instance_neighbor_advertised_route,
show_ip_bgp_instance_neighbor_advertised_route_cmd,
"show [ip] bgp [<view|vrf> WORD] [<ipv4 [<unicast|multicast>]|ipv6 [<unicast|multicast>]|encap [unicast]|vpnv4 [unicast]>] neighbors <A.B.C.D|X:X::X:X|WORD> [<received-routes|advertised-routes> [route-map WORD]] [json]",
"show [ip] bgp [<view|vrf> WORD] [<ipv4 [<unicast|multicast>]|ipv6 [<unicast|multicast>]|encap [unicast]|vpnv4 [unicast]>] neighbors <A.B.C.D|X:X::X:X|WORD> <received-routes|advertised-routes> [route-map WORD] [json]",
SHOW_STR
IP_STR
BGP_STR
Expand Down
4 changes: 2 additions & 2 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -10711,9 +10711,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);
Expand Down
Loading