diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 3b13055604..0800dd74ba 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -1391,6 +1391,7 @@ bgp_update_receive (struct peer *peer, bgp_size_t size) /* Set initial values. */ memset (&attr, 0, sizeof (struct attr)); memset (&extra, 0, sizeof (struct attr_extra)); + extra.label_index = BGP_INVALID_LABEL_INDEX; memset (&nlris, 0, sizeof (nlris)); attr.extra = &extra; memset (peer->rcvd_attr_str, 0, BUFSIZ); diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 3e51831d18..3f4f1324f8 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5860,9 +5860,8 @@ DEFUN (aggregate_address_mask, { int idx = 0; argv_find (argv, argc, "A.B.C.D", &idx); - char *prefix = argv[idx++]->arg; - argv_find (argv, argc, "A.B.C.D", &idx); - char *mask = argv[idx]->arg; + char *prefix = argv[idx]->arg; + char *mask = argv[idx+1]->arg; int as_set = argv_find (argv, argc, "as-set", &idx) ? AGGREGATE_AS_SET : 0; idx = 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; argv_find (argv, argc, "A.B.C.D", &idx); - char *prefix = argv[idx++]->arg; - argv_find (argv, argc, "A.B.C.D", &idx); - char *mask = argv[idx]->arg; + char *prefix = argv[idx]->arg; + char *mask = argv[idx++]->arg; char prefix_str[BUFSIZ]; int ret = netmask_str2prefix_str (prefix, mask, prefix_str); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 361ab33962..a30721715c 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -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 safi_wildcard = (safi == SAFI_MAX); int is_wildcard = (afi_wildcard || safi_wildcard); + bool json_output = false; if (use_json && is_wildcard) 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)) { + json_output = true; 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) vty_out (vty, "}%s", VTY_NEWLINE); - + else if (use_json && !json_output) + vty_out (vty, "{}%s", VTY_NEWLINE); } static void diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index e90228b424..1d16f11375 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1210,7 +1210,7 @@ DEFUNSH (VTYSH_BGPD, DEFUNSH (VTYSH_BGPD, address_family_ipv4_labeled_unicast, address_family_ipv4_labeled_unicast_cmd, - "address-family ipv4 labeled_unicast", + "address-family ipv4 labeled-unicast", "Enter Address Family command mode\n" "Address Family\n" "Address Family modifier\n") @@ -1258,7 +1258,7 @@ DEFUNSH (VTYSH_BGPD, DEFUNSH (VTYSH_BGPD, address_family_ipv6_labeled_unicast, address_family_ipv6_labeled_unicast_cmd, - "address-family ipv6 labeled_unicast", + "address-family ipv6 labeled-unicast", "Enter Address Family command mode\n" "Address Family\n" "Address Family modifier\n")