Merge pull request #445 from donaldsharp/robot

Robot
This commit is contained in:
Renato Westphal 2017-05-04 14:28:47 -03:00 committed by GitHub
commit 047b41ee55
4 changed files with 11 additions and 9 deletions

View File

@ -1391,6 +1391,7 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
/* Set initial values. */ /* Set initial values. */
memset (&attr, 0, sizeof (struct attr)); memset (&attr, 0, sizeof (struct attr));
memset (&extra, 0, sizeof (struct attr_extra)); memset (&extra, 0, sizeof (struct attr_extra));
extra.label_index = BGP_INVALID_LABEL_INDEX;
memset (&nlris, 0, sizeof (nlris)); memset (&nlris, 0, sizeof (nlris));
attr.extra = &extra; attr.extra = &extra;
memset (peer->rcvd_attr_str, 0, BUFSIZ); memset (peer->rcvd_attr_str, 0, BUFSIZ);

View File

@ -5860,9 +5860,8 @@ DEFUN (aggregate_address_mask,
{ {
int idx = 0; int idx = 0;
argv_find (argv, argc, "A.B.C.D", &idx); argv_find (argv, argc, "A.B.C.D", &idx);
char *prefix = argv[idx++]->arg; char *prefix = argv[idx]->arg;
argv_find (argv, argc, "A.B.C.D", &idx); char *mask = argv[idx+1]->arg;
char *mask = argv[idx]->arg;
int as_set = argv_find (argv, argc, "as-set", &idx) ? AGGREGATE_AS_SET : 0; int as_set = argv_find (argv, argc, "as-set", &idx) ? AGGREGATE_AS_SET : 0;
idx = 0; idx = 0;
int summary_only = argv_find (argv, argc, "summary-only", &idx) ? AGGREGATE_SUMMARY_ONLY : 0; int summary_only = argv_find (argv, argc, "summary-only", &idx) ? AGGREGATE_SUMMARY_ONLY : 0;
@ -5910,9 +5909,8 @@ DEFUN (no_aggregate_address_mask,
{ {
int idx = 0; int idx = 0;
argv_find (argv, argc, "A.B.C.D", &idx); argv_find (argv, argc, "A.B.C.D", &idx);
char *prefix = argv[idx++]->arg; char *prefix = argv[idx]->arg;
argv_find (argv, argc, "A.B.C.D", &idx); char *mask = argv[idx++]->arg;
char *mask = argv[idx]->arg;
char prefix_str[BUFSIZ]; char prefix_str[BUFSIZ];
int ret = netmask_str2prefix_str (prefix, mask, prefix_str); int ret = netmask_str2prefix_str (prefix, mask, prefix_str);

View File

@ -6759,6 +6759,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi,
int afi_wildcard = (afi == AFI_MAX); int afi_wildcard = (afi == AFI_MAX);
int safi_wildcard = (safi == SAFI_MAX); int safi_wildcard = (safi == SAFI_MAX);
int is_wildcard = (afi_wildcard || safi_wildcard); int is_wildcard = (afi_wildcard || safi_wildcard);
bool json_output = false;
if (use_json && is_wildcard) if (use_json && is_wildcard)
vty_out (vty, "{%s", VTY_NEWLINE); vty_out (vty, "{%s", VTY_NEWLINE);
@ -6772,6 +6773,7 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi,
{ {
if (bgp_show_summary_afi_safi_peer_exists (bgp, afi, safi)) if (bgp_show_summary_afi_safi_peer_exists (bgp, afi, safi))
{ {
json_output = true;
if (is_wildcard) if (is_wildcard)
{ {
/* /*
@ -6812,7 +6814,8 @@ bgp_show_summary_afi_safi (struct vty *vty, struct bgp *bgp, int afi, int safi,
if (use_json && is_wildcard) if (use_json && is_wildcard)
vty_out (vty, "}%s", VTY_NEWLINE); vty_out (vty, "}%s", VTY_NEWLINE);
else if (use_json && !json_output)
vty_out (vty, "{}%s", VTY_NEWLINE);
} }
static void static void

View File

@ -1210,7 +1210,7 @@ DEFUNSH (VTYSH_BGPD,
DEFUNSH (VTYSH_BGPD, DEFUNSH (VTYSH_BGPD,
address_family_ipv4_labeled_unicast, address_family_ipv4_labeled_unicast,
address_family_ipv4_labeled_unicast_cmd, address_family_ipv4_labeled_unicast_cmd,
"address-family ipv4 labeled_unicast", "address-family ipv4 labeled-unicast",
"Enter Address Family command mode\n" "Enter Address Family command mode\n"
"Address Family\n" "Address Family\n"
"Address Family modifier\n") "Address Family modifier\n")
@ -1258,7 +1258,7 @@ DEFUNSH (VTYSH_BGPD,
DEFUNSH (VTYSH_BGPD, DEFUNSH (VTYSH_BGPD,
address_family_ipv6_labeled_unicast, address_family_ipv6_labeled_unicast,
address_family_ipv6_labeled_unicast_cmd, address_family_ipv6_labeled_unicast_cmd,
"address-family ipv6 labeled_unicast", "address-family ipv6 labeled-unicast",
"Enter Address Family command mode\n" "Enter Address Family command mode\n"
"Address Family\n" "Address Family\n"
"Address Family modifier\n") "Address Family modifier\n")