From d1e7e033fdcc82015da43a7d1640ffeee486ec83 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 22 Jun 2017 13:39:47 -0400 Subject: [PATCH 1/9] bgpd: Make buffer sizes automatically the correct size In the bgp code to send routes to zebra we were spending a non trivial amount of time managing buffer sizes. We know a priori the multipath supported by our system so let's just use that value to appropriately size the buffers. Signed-off-by: Donald Sharp --- bgpd/bgp_main.c | 6 ---- bgpd/bgp_zebra.c | 94 ++++++++---------------------------------------- bgpd/bgp_zebra.h | 8 ----- 3 files changed, 14 insertions(+), 94 deletions(-) diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 9fcbff0f53..b4d71f78d2 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -232,12 +232,6 @@ bgp_exit (int status) vnc_zebra_destroy(); #endif bgp_zebra_destroy(); - if (bgp_nexthop_buf) - stream_free (bgp_nexthop_buf); - if (bgp_ifindices_buf) - stream_free (bgp_ifindices_buf); - if (bgp_label_buf) - stream_free (bgp_label_buf); /* reverse bgp_master_init */ if (bm->master) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 4fff339b85..adf6f89aac 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1222,8 +1222,7 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info u_char distance; struct peer *peer; struct bgp_info *mpinfo; - size_t oldsize, newsize; - u_int32_t nhcount, metric; + u_int32_t metric; struct bgp_info local_info; struct bgp_info *info_cp = &local_info; route_tag_t tag; @@ -1270,8 +1269,6 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info SET_FLAG (flags, ZEBRA_FLAG_INTERNAL); - nhcount = 1 + bgp_info_mpath_count (info); - if (p->family == AF_INET && !BGP_ATTR_NEXTHOP_AFI_IP6(info->attr)) { struct zapi_ipv4 api; @@ -1280,38 +1277,10 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info int valid_nh_count = 0; /* resize nexthop buffer size if necessary */ - if ((oldsize = stream_get_size (bgp_nexthop_buf)) < - (sizeof (struct in_addr *) * nhcount)) - { - newsize = sizeof (struct in_addr *) * nhcount; - newsize = stream_resize (bgp_nexthop_buf, newsize); - if (newsize == oldsize) - { - zlog_err ("can't resize nexthop buffer"); - return; - } - } stream_reset (bgp_nexthop_buf); nexthop = NULL; - /* For labeled unicast, each nexthop has a label too. Resize label - * buffer, if required. - */ - if (safi == SAFI_LABELED_UNICAST) - { - if ((oldsize = stream_get_size (bgp_label_buf)) < - (sizeof (unsigned int) * nhcount)) - { - newsize = (sizeof (unsigned int) * nhcount); - newsize = stream_resize (bgp_label_buf, newsize); - if (newsize == oldsize) - { - zlog_err ("can't resize label buffer"); - return; - } - } - stream_reset (bgp_label_buf); - } + stream_reset (bgp_label_buf); /* Metric is currently based on the best-path only. */ metric = info->attr->med; @@ -1464,52 +1433,9 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info int valid_nh_count = 0; char buf[2][INET6_ADDRSTRLEN]; - /* resize nexthop buffer size if necessary */ - if ((oldsize = stream_get_size (bgp_nexthop_buf)) < - (sizeof (struct in6_addr *) * nhcount)) - { - newsize = (sizeof (struct in6_addr *) * nhcount); - newsize = stream_resize (bgp_nexthop_buf, newsize); - if (newsize == oldsize) - { - zlog_err ("can't resize nexthop buffer"); - return; - } - } stream_reset (bgp_nexthop_buf); - - /* resize ifindices buffer size if necessary */ - if ((oldsize = stream_get_size (bgp_ifindices_buf)) < - (sizeof (unsigned int) * nhcount)) - { - newsize = (sizeof (unsigned int) * nhcount); - newsize = stream_resize (bgp_ifindices_buf, newsize); - if (newsize == oldsize) - { - zlog_err ("can't resize nexthop buffer"); - return; - } - } stream_reset (bgp_ifindices_buf); - - /* For labeled unicast, each nexthop has a label too. Resize label - * buffer, if required. - */ - if (safi == SAFI_LABELED_UNICAST) - { - if ((oldsize = stream_get_size (bgp_label_buf)) < - (sizeof (unsigned int) * nhcount)) - { - newsize = (sizeof (unsigned int) * nhcount); - newsize = stream_resize (bgp_label_buf, newsize); - if (newsize == oldsize) - { - zlog_err ("can't resize label buffer"); - return; - } - } - stream_reset (bgp_label_buf); - } + stream_reset (bgp_label_buf); ifindex = 0; nexthop = NULL; @@ -2270,14 +2196,22 @@ bgp_zebra_init (struct thread_master *master) zclient->import_check_update = bgp_read_import_check_update; zclient->fec_update = bgp_read_fec_update; - bgp_nexthop_buf = stream_new(BGP_NEXTHOP_BUF_SIZE); - bgp_ifindices_buf = stream_new(BGP_IFINDICES_BUF_SIZE); - bgp_label_buf = stream_new(BGP_LABEL_BUF_SIZE); + bgp_nexthop_buf = stream_new(multipath_num * sizeof (struct in6_addr)); + bgp_ifindices_buf = stream_new(multipath_num * sizeof (unsigned int)); + bgp_label_buf = stream_new(multipath_num * sizeof (unsigned int)); } void bgp_zebra_destroy(void) { + + if (bgp_nexthop_buf) + stream_free (bgp_nexthop_buf); + if (bgp_ifindices_buf) + stream_free (bgp_ifindices_buf); + if (bgp_label_buf) + stream_free (bgp_label_buf); + if (zclient == NULL) return; zclient_stop(zclient); diff --git a/bgpd/bgp_zebra.h b/bgpd/bgp_zebra.h index 6a36fb84f7..3d634ed695 100644 --- a/bgpd/bgp_zebra.h +++ b/bgpd/bgp_zebra.h @@ -21,14 +21,6 @@ #ifndef _QUAGGA_BGP_ZEBRA_H #define _QUAGGA_BGP_ZEBRA_H -#define BGP_NEXTHOP_BUF_SIZE (8 * sizeof (struct in_addr *)) -#define BGP_IFINDICES_BUF_SIZE (8 * sizeof (unsigned int)) -#define BGP_LABEL_BUF_SIZE (8 * sizeof (unsigned int)) - -extern struct stream *bgp_nexthop_buf; -extern struct stream *bgp_ifindices_buf; -extern struct stream *bgp_label_buf; - extern void bgp_zebra_init (struct thread_master *master); extern void bgp_zebra_destroy (void); extern int bgp_if_update_all (void); From 434f47215873dce33551f78a134c113a1cdcb621 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 22 Jun 2017 14:28:23 -0400 Subject: [PATCH 2/9] bgpd: Refactor looping for talking to zebra The data for each nexthop is stored off of the info pointer, instead of handling the first one and then looping over the remaining, just loop over them all and handle the first one as a special case. Signed-off-by: Donald Sharp --- bgpd/bgp_zebra.c | 121 +++++++++++------------------------------------ 1 file changed, 28 insertions(+), 93 deletions(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index adf6f89aac..c67acdb8c4 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1282,44 +1282,12 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info stream_reset (bgp_label_buf); - /* Metric is currently based on the best-path only. */ - metric = info->attr->med; - if (bgp->table_map[afi][safi].name) - { - BGP_INFO_ATTR_BUF_INIT(); + BGP_INFO_ATTR_BUF_INIT(); - /* Copy info and attributes, so the route-map apply doesn't modify the - BGP route info. */ - BGP_INFO_ATTR_BUF_COPY(info, info_cp); - if (bgp_table_map_apply(bgp->table_map[afi][safi].map, p, info_cp)) - { - metric = info_cp->attr->med; - nexthop = &info_cp->attr->nexthop; - - if (info_cp->attr->extra) - tag = info_cp->attr->extra->tag; - } - BGP_INFO_ATTR_BUF_FREE(info_cp); - } - else - { - nexthop = &info->attr->nexthop; - } - - if (nexthop) - { - stream_put (bgp_nexthop_buf, &nexthop, sizeof (struct in_addr *)); - valid_nh_count++; - if (safi == SAFI_LABELED_UNICAST) - { - label = label_pton(info->extra->tag); - stream_put (bgp_label_buf, &label, sizeof (u_int32_t)); - } - } - - for (mpinfo = bgp_info_mpath_first (info); mpinfo; - mpinfo = bgp_info_mpath_next (mpinfo)) + /* Metric is currently based on the best-path only */ + metric = info->attr->med; + for (mpinfo = info ; mpinfo; mpinfo = bgp_info_mpath_next (mpinfo)) { nexthop = NULL; @@ -1329,13 +1297,19 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info BGP route info. */ BGP_INFO_ATTR_BUF_COPY(mpinfo, info_cp); if (bgp_table_map_apply(bgp->table_map[afi][safi].map, p, info_cp)) - nexthop = &info_cp->attr->nexthop; + { + if (mpinfo == info) + { + /* Metric is currently based on the best-path only */ + metric = info_cp->attr->med; + tag = info_cp->attr->extra->tag; + } + nexthop = &info_cp->attr->nexthop; + } BGP_INFO_ATTR_BUF_FREE(info_cp); } else - { - nexthop = &mpinfo->attr->nexthop; - } + nexthop = &mpinfo->attr->nexthop; if (nexthop == NULL) continue; @@ -1442,56 +1416,11 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info assert (info->attr->extra); - /* Metric is currently based on the best-path only. */ - metric = info->attr->med; - if (bgp->table_map[afi][safi].name) - { - BGP_INFO_ATTR_BUF_INIT(); + BGP_INFO_ATTR_BUF_INIT(); - /* Copy info and attributes, so the route-map apply doesn't modify the - BGP route info. */ - BGP_INFO_ATTR_BUF_COPY(info, info_cp); - if (bgp_table_map_apply(bgp->table_map[afi][safi].map, p, info_cp)) - { - metric = info_cp->attr->med; - nexthop = bgp_info_to_ipv6_nexthop(info_cp); - - if (info_cp->attr->extra) - tag = info_cp->attr->extra->tag; - } - BGP_INFO_ATTR_BUF_FREE(info_cp); - } - else - { - nexthop = bgp_info_to_ipv6_nexthop(info); - } - - if (nexthop) - { - if (info->attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) - if (info->peer->nexthop.ifp) - ifindex = info->peer->nexthop.ifp->ifindex; - - if (!ifindex) - { - if (info->peer->conf_if || info->peer->ifname) - ifindex = if_nametoindex (info->peer->conf_if ? info->peer->conf_if : info->peer->ifname); - else if (info->peer->nexthop.ifp) - ifindex = info->peer->nexthop.ifp->ifindex; - } - stream_put (bgp_nexthop_buf, &nexthop, sizeof (struct in6_addr *)); - stream_put (bgp_ifindices_buf, &ifindex, sizeof (unsigned int)); - if (safi == SAFI_LABELED_UNICAST) - { - label = label_pton(info->extra->tag); - stream_put (bgp_label_buf, &label, sizeof (u_int32_t)); - } - valid_nh_count++; - } - - for (mpinfo = bgp_info_mpath_first (info); mpinfo; - mpinfo = bgp_info_mpath_next (mpinfo)) + metric = info->attr->med; + for (mpinfo = info ; mpinfo; mpinfo = bgp_info_mpath_next (mpinfo)) { ifindex = 0; nexthop = NULL; @@ -1502,18 +1431,24 @@ bgp_zebra_announce (struct bgp_node *rn, struct prefix *p, struct bgp_info *info BGP route info. */ BGP_INFO_ATTR_BUF_COPY(mpinfo, info_cp); if (bgp_table_map_apply(bgp->table_map[afi][safi].map, p, info_cp)) - nexthop = bgp_info_to_ipv6_nexthop(info_cp); + { + if (mpinfo == info) + { + metric = info_cp->attr->med; + tag = info_cp->attr->extra->tag; + } + nexthop = bgp_info_to_ipv6_nexthop(info_cp); + } BGP_INFO_ATTR_BUF_FREE(info_cp); } else - { - nexthop = bgp_info_to_ipv6_nexthop(mpinfo); - } + nexthop = bgp_info_to_ipv6_nexthop(mpinfo); if (nexthop == NULL) continue; - if (mpinfo->attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) + if ((mpinfo == info) && + mpinfo->attr->extra->mp_nexthop_len == BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL) if (mpinfo->peer->nexthop.ifp) ifindex = mpinfo->peer->nexthop.ifp->ifindex; From a79d6ebb485f5bb81d576e6d88bf2b00f524d264 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 5 Jul 2017 12:56:52 -0400 Subject: [PATCH 3/9] zebra: fix mpls_str2label() When making improvements to error handling in this code I accidentally introduced an off-by-one. Fix it. Signed-off-by: Quentin Young --- zebra/zebra_mpls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index e08ff08cf6..93844ee2a6 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -1774,7 +1774,7 @@ mpls_str2label (const char *label_str, u_int8_t *num_labels, if (!rc) { - *num_labels = i + 1; + *num_labels = i; memcpy (labels, pl, *num_labels * sizeof (mpls_label_t)); } From ebb0813089c7bcc8e23b7921a77dc5b2d0d02709 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 5 Jul 2017 13:20:21 -0400 Subject: [PATCH 4/9] lib: warn about too much docstring Signed-off-by: Quentin Young --- lib/command_parse.y | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/command_parse.y b/lib/command_parse.y index 3337481094..ba042c33be 100644 --- a/lib/command_parse.y +++ b/lib/command_parse.y @@ -443,6 +443,14 @@ terminate_graph (CMD_YYLTYPE *locp, struct parser_ctx *ctx, struct graph_node *end_element_node = graph_new_node (ctx->graph, element, NULL); + if (ctx->docstr && strlen (ctx->docstr) > 1) { + zlog_debug ("Excessive docstring while parsing '%s'", ctx->el->string); + zlog_debug ("----------"); + while (ctx->docstr && ctx->docstr[1] != '\0') + zlog_debug ("%s", strsep(&ctx->docstr, "\n")); + zlog_debug ("----------\n"); + } + graph_add_edge (finalnode, end_token_node); graph_add_edge (end_token_node, end_element_node); } From 17fd484615fdb5f7f19f61324be08b457b4d7570 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 5 Jul 2017 15:30:19 -0400 Subject: [PATCH 5/9] doc: update build docs for ubuntu cumulus/etc --> tools/etc Signed-off-by: Quentin Young --- doc/Building_FRR_on_Ubuntu1204.md | 8 ++++---- doc/Building_FRR_on_Ubuntu1404.md | 8 ++++---- doc/Building_FRR_on_Ubuntu1604.md | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/Building_FRR_on_Ubuntu1204.md b/doc/Building_FRR_on_Ubuntu1204.md index 033e05bcdb..e8567867cc 100644 --- a/doc/Building_FRR_on_Ubuntu1204.md +++ b/doc/Building_FRR_on_Ubuntu1204.md @@ -134,10 +134,10 @@ other settings) ### Install the init.d service - sudo install -m 755 tools/frr /etc/init.d/frr - sudo install -m 644 cumulus/etc/frr/daemons /etc/frr/daemons - sudo install -m 644 cumulus/etc/frr/daemons.conf /etc/frr/daemons.conf - sudo install -m 644 -o frr -g frr cumulus/etc/frr/vtysh.conf /etc/frr/vtysh.conf + sudo install -m 755 tools/frr /etc/init.d/frr + sudo install -m 644 tools/etc/frr/daemons /etc/frr/daemons + sudo install -m 644 tools/etc/frr/daemons.conf /etc/frr/daemons.conf + sudo install -m 644 -o frr -g frr tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf ### Enable daemons Edit `/etc/frr/daemons` and change the value from "no" to "yes" for those daemons you want to start by systemd. diff --git a/doc/Building_FRR_on_Ubuntu1404.md b/doc/Building_FRR_on_Ubuntu1404.md index 11daecf195..a0f3a121ff 100644 --- a/doc/Building_FRR_on_Ubuntu1404.md +++ b/doc/Building_FRR_on_Ubuntu1404.md @@ -94,10 +94,10 @@ other settings) **Reboot** or use `sysctl -p` to apply the same config to the running system ### Install the init.d service - sudo install -m 755 tools/frr /etc/init.d/frr - sudo install -m 644 cumulus/etc/frr/daemons /etc/frr/daemons - sudo install -m 644 cumulus/etc/frr/daemons.conf /etc/frr/daemons.conf - sudo install -m 644 -o frr -g frr cumulus/etc/frr/vtysh.conf /etc/frr/vtysh.conf + sudo install -m 755 tools/frr /etc/init.d/frr + sudo install -m 644 tools/etc/frr/daemons /etc/frr/daemons + sudo install -m 644 tools/etc/frr/daemons.conf /etc/frr/daemons.conf + sudo install -m 644 -o frr -g frr tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf ### Enable daemons diff --git a/doc/Building_FRR_on_Ubuntu1604.md b/doc/Building_FRR_on_Ubuntu1604.md index 9aa3206fee..9144d4610b 100644 --- a/doc/Building_FRR_on_Ubuntu1604.md +++ b/doc/Building_FRR_on_Ubuntu1604.md @@ -116,12 +116,12 @@ Add the following lines to `/etc/modules-load.d/modules.conf`: ### Install the systemd service - sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service - sudo install -m 644 cumulus/etc/default/frr /etc/default/frr - sudo install -m 644 cumulus/etc/frr/daemons /etc/frr/daemons + sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service + sudo install -m 644 tools/etc/default/frr /etc/default/frr + sudo install -m 644 tools/etc/frr/daemons /etc/frr/daemons sudo install -m 644 tools/etc/frr/daemons.conf /etc/frr/daemons.conf sudo install -m 644 tools/etc/frr/frr.conf /etc/frr/frr.conf - sudo install -m 644 -o frr -g frr cumulus/etc/frr/vtysh.conf /etc/frr/vtysh.conf + sudo install -m 644 -o frr -g frr tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf ### Enable daemons From 7111c1a0cd00440fc5aa188eedbabde2a706bff0 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 5 Jul 2017 14:30:36 -0400 Subject: [PATCH 6/9] *: fix excess docstring Signed-off-by: Quentin Young --- babeld/babeld.c | 3 +- bgpd/bgp_route.c | 1 - bgpd/bgp_vty.c | 19 +++++-------- bgpd/rfapi/bgp_rfapi_cfg.c | 8 ++---- bgpd/rfapi/rfapi_vty.c | 16 ++++------- isisd/isis_vty.c | 15 +++------- lib/plist.c | 4 +-- ospf6d/ospf6_interface.c | 4 +-- ospf6d/ospf6_top.c | 2 -- ospfd/ospf_vty.c | 18 ++++-------- pimd/pim_cmd.c | 3 -- ripd/rip_interface.c | 58 ++++++-------------------------------- vtysh/vtysh.c | 8 ++---- zebra/zebra_vty.c | 45 ++++++++++------------------- 14 files changed, 53 insertions(+), 151 deletions(-) diff --git a/babeld/babeld.c b/babeld/babeld.c index b44b25ab4e..e17e00ca56 100644 --- a/babeld/babeld.c +++ b/babeld/babeld.c @@ -617,8 +617,7 @@ DEFUN (no_router_babel, "no router babel", NO_STR "Disable a routing process\n" - "Remove Babel instance command\n" - "No attributes\n") + "Remove Babel instance command\n") { if(babel_routing_process) babel_clean_routing_process(); diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 404360a3af..5a711c1e75 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -9436,7 +9436,6 @@ DEFUN (show_ip_bgp_instance_neighbor_prefix_counts, "Address Family modifier\n" "Address Family modifier\n" "Address Family modifier\n" - "Address Family modifier\n" "Detailed information on TCP and BGP neighbor connections\n" "Neighbor to display information about\n" "Neighbor to display information about\n" diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 6e998085c1..5b5f4096c0 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -1376,7 +1376,6 @@ DEFUN (bgp_update_delay_establish_wait, "update-delay (0-3600) (1-3600)", "Force initial delay for best-path and updates\n" "Seconds\n" - "Wait for peers to be established\n" "Seconds\n") { int idx_number = 1; @@ -1391,7 +1390,7 @@ DEFUN (no_bgp_update_delay, NO_STR "Force initial delay for best-path and updates\n" "Seconds\n" - "Wait for peers to be established\n") + "Seconds\n") { return bgp_update_delay_deconfig_vty(vty); } @@ -6240,11 +6239,10 @@ DEFUN_NOSH (address_family_vpnv6, DEFUN_NOSH (address_family_evpn, address_family_evpn_cmd, - "address-family ", + "address-family l2vpn evpn", "Enter Address Family command mode\n" - "EVPN Address family\n" - "Layer2 VPN Address family\n" - "Ethernet Virtual Private Network Subsequent Address Family\n") + "Address Family\n" + "Address Family modifier\n") { vty->node = BGP_EVPN_NODE; return CMD_SUCCESS; @@ -9620,8 +9618,7 @@ DEFUN (show_bgp_updgrps_afi_adj, "Detailed info about dynamic update groups\n" "Advertisement queue\n" "Announced routes\n" - "Packet queue\n" - "Specific subgroup info wanted for\n") + "Packet queue\n") { int idx_afi = 2; int idx_safi = 3; @@ -9726,8 +9723,7 @@ DEFUN (show_bgp_updgrps_afi_adj_s, "Specific subgroup to display info for\n" "Advertisement queue\n" "Announced routes\n" - "Packet queue\n" - "Specific subgroup info wanted for\n") + "Packet queue\n") { int idx_afi = 2; int idx_safi = 3; @@ -12180,8 +12176,7 @@ DEFUN (ip_lcommunity_list_standard, LCOMMUNITY_LIST_STR "Large Community list number (standard)\n" "Specify large community to reject\n" - "Specify large community to accept\n" - LCOMMUNITY_VAL_STR) + "Specify large community to accept\n") { return lcommunity_list_set_vty (vty, argc, argv, LARGE_COMMUNITY_LIST_STANDARD, 0); } diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 5cd8528ea9..14cce2d606 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -1313,9 +1313,9 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist, NO_STR "Redistribute from other protocol\n" "Redistribute from BGP directly\n" - "Disable redistribute filter\n" "IPv4 routes\n" - "IPv6 routes\n" "Prefix-list for filtering redistributed routes\n") + "IPv6 routes\n" + "Prefix-list for filtering redistributed routes\n") { VTY_DECLVAR_CONTEXT(bgp, bgp); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg) @@ -1412,7 +1412,6 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap, NO_STR "Redistribute from other protocols\n" "Redistribute from BGP directly\n" - "Disable redistribute filter\n" "Route-map for filtering redistributed routes\n") { VTY_DECLVAR_CONTEXT(bgp, bgp); @@ -2076,7 +2075,6 @@ DEFUN (vnc_nve_export_prefixlist, "Export to other protocols\n" "Export to BGP\n" "Export to Zebra (experimental)\n" - "Filters, used in 'registering-nve' export mode\n" "IPv4 prefixes\n" "IPv6 prefixes\n" "Prefix-list for filtering exported routes\n" "Prefix list name\n") @@ -2178,7 +2176,6 @@ DEFUN (vnc_nve_export_routemap, "Export to other protocols\n" "Export to BGP\n" "Export to Zebra (experimental)\n" - "Filters, used in 'registering-nve' export mode\n" "Route-map for filtering exported routes\n" "Route map name\n") { VTY_DECLVAR_CONTEXT(bgp, bgp); @@ -3918,7 +3915,6 @@ DEFUN (vnc_l2_group_no_labels, vnc_l2_group_no_labels_cmd, "no labels LABELLIST...", NO_STR - "Remove label values associated with L2 group\n" "Specify label values associated with L2 group\n" "Space separated list of label values <0-1048575>\n") { diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 2062164890..791082bcbe 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -2672,8 +2672,7 @@ DEFUN (add_vnc_prefix_cost_life, "Administrative cost [default: 255]\n" "Administrative cost\n" "Registration lifetime [default: infinite]\n" - "Lifetime value in seconds\n" - "[local-next-hop (A.B.C.D|X:X::X:X)] [local-cost <0-255>]\n") + "Lifetime value in seconds\n") { /* pfx vn un cost life */ return register_add (vty, argv[3], argv[5], argv[7], argv[9], argv[11], @@ -2698,8 +2697,7 @@ DEFUN (add_vnc_prefix_life_cost, "Registration lifetime [default: infinite]\n" "Lifetime value in seconds\n" "Administrative cost [default: 255]\n" - "Administrative cost\n" - "[local-next-hop (A.B.C.D|X:X::X:X)] [local-cost <0-255>]\n") + "Administrative cost\n") { /* pfx vn un cost life */ return register_add (vty, argv[3], argv[5], argv[7], argv[11], argv[9], @@ -2722,8 +2720,7 @@ DEFUN (add_vnc_prefix_cost, "UN IPv4 interface address\n" "UN IPv6 interface address\n" "Administrative cost [default: 255]\n" - "Administrative cost\n" - "[local-next-hop (A.B.C.D|X:X::X:X)] [local-cost <0-255>]\n") + "Administrative cost\n") { /* pfx vn un cost life */ return register_add (vty, argv[3], argv[5], argv[7], argv[9], NULL, @@ -2746,8 +2743,7 @@ DEFUN (add_vnc_prefix_life, "UN IPv4 interface address\n" "UN IPv6 interface address\n" "Registration lifetime [default: infinite]\n" - "Lifetime value in seconds\n" - "[local-next-hop (A.B.C.D|X:X::X:X)] [local-cost <0-255>]\n") + "Lifetime value in seconds\n") { /* pfx vn un cost life */ return register_add (vty, argv[3], argv[5], argv[7], NULL, argv[9], @@ -2768,8 +2764,7 @@ DEFUN (add_vnc_prefix, "VN IPv6 interface address\n" "UN address of NVE\n" "UN IPv4 interface address\n" - "UN IPv6 interface address\n" - "[local-next-hop (A.B.C.D|X:X::X:X)] [local-cost <0-255>]\n") + "UN IPv6 interface address\n") { /* pfx vn un cost life */ return register_add (vty, argv[3], argv[5], argv[7], NULL, NULL, @@ -4064,7 +4059,6 @@ DEFUN (clear_vnc_mac_vn_un, "VNI keyword\n" "Any virtual network identifier\n" "Virtual network identifier\n" - "Virtual network identifier\n" "VN address of NVE\n" "All VN addresses\n" "VN IPv4 interface address\n" diff --git a/isisd/isis_vty.c b/isisd/isis_vty.c index b603ab5dc9..f0e2831bff 100644 --- a/isisd/isis_vty.c +++ b/isisd/isis_vty.c @@ -673,7 +673,6 @@ DEFUN (isis_hello_interval, "isis hello-interval (1-600)", "IS-IS commands\n" "Set Hello interval\n" - "Hello interval value\n" "Holdtime 1 seconds, interval depends on multiplier\n") { int idx_number = 2; @@ -721,7 +720,6 @@ DEFUN (isis_hello_interval_l1, "isis hello-interval (1-600) level-1", "IS-IS commands\n" "Set Hello interval\n" - "Hello interval value\n" "Holdtime 1 second, interval depends on multiplier\n" "Specify hello-interval for level-1 IIHs\n") { @@ -769,7 +767,6 @@ DEFUN (isis_hello_interval_l2, "isis hello-interval (1-600) level-2", "IS-IS commands\n" "Set Hello interval\n" - "Hello interval value\n" "Holdtime 1 second, interval depends on multiplier\n" "Specify hello-interval for level-2 IIHs\n") { @@ -958,8 +955,7 @@ DEFUN (isis_hello_padding, "isis hello padding", "IS-IS commands\n" "Add padding to IS-IS hello packets\n" - "Pad hello packets\n" - "\n") + "Pad hello packets\n") { struct isis_circuit *circuit = isis_circuit_lookup (vty); if (!circuit) @@ -976,8 +972,7 @@ DEFUN (no_isis_hello_padding, NO_STR "IS-IS commands\n" "Add padding to IS-IS hello packets\n" - "Pad hello packets\n" - "\n") + "Pad hello packets\n") { struct isis_circuit *circuit = isis_circuit_lookup (vty); if (!circuit) @@ -1431,8 +1426,7 @@ DEFUN (no_metric_style, DEFUN (set_overload_bit, set_overload_bit_cmd, "set-overload-bit", - "Set overload bit to avoid any transit traffic\n" - "Set overload bit\n") + "Set overload bit to avoid any transit traffic\n") { VTY_DECLVAR_CONTEXT (isis_area, area); @@ -1455,8 +1449,7 @@ DEFUN (no_set_overload_bit, DEFUN (set_attached_bit, set_attached_bit_cmd, "set-attached-bit", - "Set attached bit to identify as L1/L2 router for inter-area traffic\n" - "Set attached bit\n") + "Set attached bit to identify as L1/L2 router for inter-area traffic\n") { VTY_DECLVAR_CONTEXT (isis_area, area); diff --git a/lib/plist.c b/lib/plist.c index 172f2b39db..339540a2b5 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -1736,9 +1736,7 @@ DEFPY (show_ipv6_prefix_list, PREFIX_LIST_STR "Name of a prefix list\n" "sequence number of an entry\n" - "Sequence number\n" - "Lookup longer prefix\n" - "First matched prefix\n") + "Sequence number\n") { enum display_type dtype = normal_display; if (dseq) diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index e50de6fab2..e91c249845 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1729,9 +1729,7 @@ DEFUN (no_ipv6_ospf6_network, NO_STR IP6_STR OSPF6_STR - "Network type\n" - "Default to whatever interface type system specifies" - ) + "Set default network type\n") { VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 2f157d98a0..268b7a60a2 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -697,7 +697,6 @@ DEFUN (ospf6_stub_router_admin, ospf6_stub_router_admin_cmd, "stub-router administrative", "Make router a stub router\n" - "Advertise inability to be a transit router\n" "Administratively applied, for an indefinite period\n") { struct listnode *node; @@ -722,7 +721,6 @@ DEFUN (no_ospf6_stub_router_admin, "no stub-router administrative", NO_STR "Make router a stub router\n" - "Advertise ability to be a transit router\n" "Administratively applied, for an indefinite period\n") { struct listnode *node; diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 799214c9c5..bc98da45ee 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -7095,8 +7095,7 @@ DEFUN (ospf_redistribute_source, "Metric for redistributed routes\n" "OSPF default metric\n" "OSPF exterior metric type for redistributed routes\n" - "Set OSPF External Type 1 metrics\n" - "Set OSPF External Type 2 metrics\n" + "Set OSPF External Type 1/2 metrics\n" "Route map reference\n" "Pointer to route-map entries\n") { @@ -7147,8 +7146,7 @@ DEFUN (no_ospf_redistribute_source, "Metric for redistributed routes\n" "OSPF default metric\n" "OSPF exterior metric type for redistributed routes\n" - "Set OSPF External Type 1 metrics\n" - "Set OSPF External Type 2 metrics\n" + "Set OSPF External Type 1/2 metrics\n" "Route map reference\n" "Pointer to route-map entries\n") { @@ -7179,8 +7177,7 @@ DEFUN (ospf_redistribute_instance_source, "Metric for redistributed routes\n" "OSPF default metric\n" "OSPF exterior metric type for redistributed routes\n" - "Set OSPF External Type 1 metrics\n" - "Set OSPF External Type 2 metrics\n" + "Set OSPF External Type 1/2 metrics\n" "Route map reference\n" "Pointer to route-map entries\n") { @@ -7251,8 +7248,7 @@ DEFUN (no_ospf_redistribute_instance_source, "Metric for redistributed routes\n" "OSPF default metric\n" "OSPF exterior metric type for redistributed routes\n" - "Set OSPF External Type 1 metrics\n" - "Set OSPF External Type 2 metrics\n" + "Set OSPF External Type 1/2 metrics\n" "Route map reference\n" "Pointer to route-map entries\n") { @@ -7345,8 +7341,7 @@ DEFUN (ospf_default_information_originate, "OSPF default metric\n" "OSPF metric\n" "OSPF metric type for default routes\n" - "Set OSPF External Type 1 metrics\n" - "Set OSPF External Type 2 metrics\n" + "Set OSPF External Type 1/2 metrics\n" "Route map reference\n" "Pointer to route-map entries\n") { @@ -7392,8 +7387,7 @@ DEFUN (no_ospf_default_information_originate, "OSPF default metric\n" "OSPF metric\n" "OSPF metric type for default routes\n" - "Set OSPF External Type 1 metrics\n" - "Set OSPF External Type 2 metrics\n" + "Set OSPF External Type 1/2 metrics\n" "Route map reference\n" "Pointer to route-map entries\n") { diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 0051298e4a..b0afc7828a 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -4256,7 +4256,6 @@ DEFUN_HIDDEN (no_ip_multicast_routing, "no ip multicast-routing", NO_STR IP_STR - "Global IP configuration subcommands\n" "Enable IP multicast forwarding\n") { vty_outln (vty, @@ -5732,7 +5731,6 @@ DEFUN (debug_ssmpingd, debug_ssmpingd_cmd, "debug ssmpingd", DEBUG_STR - DEBUG_PIM_STR DEBUG_SSMPINGD_STR) { PIM_DO_DEBUG_SSMPINGD; @@ -5744,7 +5742,6 @@ DEFUN (no_debug_ssmpingd, "no debug ssmpingd", NO_STR DEBUG_STR - DEBUG_PIM_STR DEBUG_SSMPINGD_STR) { PIM_DONT_DEBUG_SSMPINGD; diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 425b01c247..4ce1b9b655 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -1327,8 +1327,7 @@ DEFUN (ip_rip_receive_version, "Routing Information Protocol\n" "Advertisement reception\n" "Version control\n" - "RIP version 1\n" - "RIP version 2\n" + "RIP version\n" "None\n") { VTY_DECLVAR_CONTEXT(interface, ifp); @@ -1357,31 +1356,13 @@ DEFUN (ip_rip_receive_version, DEFUN (ip_rip_receive_version_1, ip_rip_receive_version_1_cmd, - "ip rip receive version (1-1) (2-2)", + "ip rip receive version <1 2|2 1>", IP_STR "Routing Information Protocol\n" "Advertisement reception\n" "Version control\n" "RIP version 1\n" - "RIP version 2\n") -{ - VTY_DECLVAR_CONTEXT(interface, ifp); - struct rip_interface *ri; - - ri = ifp->info; - - /* Version 1 and 2. */ - ri->ri_receive = RI_RIP_VERSION_1_AND_2; - return CMD_SUCCESS; -} - -DEFUN (ip_rip_receive_version_2, - ip_rip_receive_version_2_cmd, - "ip rip receive version (2-2) (1-1)", - IP_STR - "Routing Information Protocol\n" - "Advertisement reception\n" - "Version control\n" + "RIP version 2\n" "RIP version 2\n" "RIP version 1\n") { @@ -1403,8 +1384,7 @@ DEFUN (no_ip_rip_receive_version, "Routing Information Protocol\n" "Advertisement reception\n" "Version control\n" - "Version 1\n" - "Version 2\n") + "RIP version\n") { VTY_DECLVAR_CONTEXT(interface, ifp); struct rip_interface *ri; @@ -1423,8 +1403,7 @@ DEFUN (ip_rip_send_version, "Routing Information Protocol\n" "Advertisement transmission\n" "Version control\n" - "RIP version 1\n" - "RIP version 2\n") + "RIP version\n") { VTY_DECLVAR_CONTEXT(interface, ifp); int idx_type = 4; @@ -1448,31 +1427,13 @@ DEFUN (ip_rip_send_version, DEFUN (ip_rip_send_version_1, ip_rip_send_version_1_cmd, - "ip rip send version (1-1) (2-2)", + "ip rip send version <1 2|2 1>", IP_STR "Routing Information Protocol\n" "Advertisement transmission\n" "Version control\n" "RIP version 1\n" - "RIP version 2\n") -{ - VTY_DECLVAR_CONTEXT(interface, ifp); - struct rip_interface *ri; - - ri = ifp->info; - - /* Version 1 and 2. */ - ri->ri_send = RI_RIP_VERSION_1_AND_2; - return CMD_SUCCESS; -} - -DEFUN (ip_rip_send_version_2, - ip_rip_send_version_2_cmd, - "ip rip send version (2-2) (1-1)", - IP_STR - "Routing Information Protocol\n" - "Advertisement transmission\n" - "Version control\n" + "RIP version 2\n" "RIP version 2\n" "RIP version 1\n") { @@ -1494,8 +1455,7 @@ DEFUN (no_ip_rip_send_version, "Routing Information Protocol\n" "Advertisement transmission\n" "Version control\n" - "Version 1\n" - "Version 2\n") + "RIP version\n") { VTY_DECLVAR_CONTEXT(interface, ifp); struct rip_interface *ri; @@ -2034,12 +1994,10 @@ rip_if_init (void) install_element (INTERFACE_NODE, &ip_rip_send_version_cmd); install_element (INTERFACE_NODE, &ip_rip_send_version_1_cmd); - install_element (INTERFACE_NODE, &ip_rip_send_version_2_cmd); install_element (INTERFACE_NODE, &no_ip_rip_send_version_cmd); install_element (INTERFACE_NODE, &ip_rip_receive_version_cmd); install_element (INTERFACE_NODE, &ip_rip_receive_version_1_cmd); - install_element (INTERFACE_NODE, &ip_rip_receive_version_2_cmd); install_element (INTERFACE_NODE, &no_ip_rip_receive_version_cmd); install_element (INTERFACE_NODE, &ip_rip_v2_broadcast_cmd); diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 0e04f4bf8e..fe402f7098 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -1271,9 +1271,8 @@ DEFUNSH (VTYSH_BGPD, address_family_evpn_cmd, "address-family ", "Enter Address Family command mode\n" - "EVPN Address family\n" - "Layer2 VPN Address family\n" - "Ethernet Virtual Private Network Subsequent Address Family\n") + "Address Family\n" + "Address Family modifier\n") { vty->node = BGP_EVPN_NODE; return CMD_SUCCESS; @@ -2445,10 +2444,9 @@ DEFUNSH (VTYSH_ALL, DEFUNSH (VTYSH_ALL, vtysh_config_password, vtysh_password_cmd, - "password (8-8) WORD", + "password [(8-8)] WORD", "Assign the terminal connection password\n" "Specifies a HIDDEN password will follow\n" - "dummy string \n" "The HIDDEN line password string\n") { return CMD_SUCCESS; diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index c861efbddf..06412e1b3f 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -433,8 +433,7 @@ DEFUN (ip_route_flags, "Set tag for this route\n" "Tag value\n" "Distance value for this route\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv4_prefixlen = 2; int idx_reject_blackhole = 3; @@ -466,8 +465,7 @@ DEFUN (ip_route_mask, "Set tag for this route\n" "Tag value\n" "Distance value for this route\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv4 = 2; int idx_ipv4_2 = 3; @@ -497,8 +495,7 @@ DEFUN (ip_route_mask_flags, "Set tag for this route\n" "Tag value\n" "Distance value for this route\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv4 = 2; int idx_ipv4_2 = 3; @@ -530,8 +527,7 @@ DEFUN (no_ip_route, "Tag of this route\n" "Tag value\n" "Distance value for this route\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv4_prefixlen = 3; int idx_ipv4_ifname_null = 4; @@ -561,8 +557,7 @@ DEFUN (no_ip_route_flags, "Tag of this route\n" "Tag value\n" "Distance value for this route\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv4_prefixlen = 3; int idx_curr = 5; @@ -591,8 +586,7 @@ DEFUN (no_ip_route_mask, "Tag of this route\n" "Tag value\n" "Distance value for this route\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv4 = 3; int idx_ipv4_2 = 4; @@ -624,8 +618,7 @@ DEFUN (no_ip_route_mask_flags, "Tag of this route\n" "Tag value\n" "Distance value for this route\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv4 = 3; int idx_ipv4_2 = 4; @@ -2171,8 +2164,7 @@ DEFUN (ipv6_route, "Set tag for this route\n" "Tag value\n" "Distance value for this prefix\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv6_prefixlen = 2; int idx_ipv6_ifname; @@ -2218,8 +2210,7 @@ DEFUN (ipv6_route_flags, "Set tag for this route\n" "Tag value\n" "Distance value for this prefix\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv6_prefixlen = 2; int idx_ipv6_ifname; @@ -2267,8 +2258,7 @@ DEFUN (ipv6_route_ifname, "Set tag for this route\n" "Tag value\n" "Distance value for this prefix\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv6_prefixlen = 2; int idx_ipv6 = 3; @@ -2318,8 +2308,7 @@ DEFUN (ipv6_route_ifname_flags, "Set tag for this route\n" "Tag value\n" "Distance value for this prefix\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv6_prefixlen = 2; int idx_ipv6; @@ -2372,8 +2361,7 @@ DEFUN (no_ipv6_route, "Set tag for this route\n" "Tag value\n" "Distance value for this prefix\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv6_prefixlen = 3; int idx_ipv6_ifname; @@ -2420,8 +2408,7 @@ DEFUN (no_ipv6_route_flags, "Set tag for this route\n" "Tag value\n" "Distance value for this prefix\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv6_prefixlen = 3; int idx_ipv6_ifname; @@ -2470,8 +2457,7 @@ DEFUN (no_ipv6_route_ifname, "Set tag for this route\n" "Tag value\n" "Distance value for this prefix\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv6_prefixlen = 3; int idx_ipv6; @@ -2522,8 +2508,7 @@ DEFUN (no_ipv6_route_ifname_flags, "Set tag for this route\n" "Tag value\n" "Distance value for this prefix\n" - VRF_CMD_HELP_STR - MPLS_LABEL_HELPSTR) + VRF_CMD_HELP_STR) { int idx_ipv6_prefixlen = 3; int idx_ipv6; From a7a13e4ac42f0d31d3d200cb8f354e5a6c811786 Mon Sep 17 00:00:00 2001 From: Daniel Walton Date: Wed, 5 Jul 2017 20:14:13 +0000 Subject: [PATCH 7/9] bgpd: "address-family" not displayed in configuration Signed-off-by: Daniel Walton Reviewed-by: Donald Sharp --- bgpd/bgpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 65b53be653..9dd0374c9d 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -7254,7 +7254,7 @@ bgp_config_write_family_header (struct vty *vty, afi_t afi, safi_t safi, if (*write) return; - vty_outln (vty, " !%s address-family ", VTYNL); + vty_out (vty, " !%s address-family ", VTYNL); if (afi == AFI_IP) { From ecf3d1b9d5ff9bf11a9e79a8e4efb63eff4eb10e Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 6 Jul 2017 16:55:33 +0200 Subject: [PATCH 8/9] lib: fix vty_out with >1024 bytes of output Consuming va_args modifies its internal bits, hence the need to copy it... but the copying wasn't quite right just yet. Fixes: 4d5f445 ("lib: add vty_outln()") Signed-off-by: David Lamparter --- lib/vty.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/vty.c b/lib/vty.c index 145bcfe945..e6497b3100 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -107,7 +107,7 @@ vty_out_variadic (struct vty *vty, const char *format, va_list args) { /* Try to write to initial buffer. */ va_copy (cp, args); - len = vsnprintf (buf, sizeof(buf), format, args); + len = vsnprintf (buf, sizeof(buf), format, cp); va_end (cp); /* Initial buffer is not enough. */ @@ -124,7 +124,9 @@ vty_out_variadic (struct vty *vty, const char *format, va_list args) if (! p) return -1; - len = vsnprintf (p, size, format, args); + va_copy (cp, args); + len = vsnprintf (p, size, format, cp); + va_end (cp); if (len > -1 && len < size) break; From 007b0667e00fde98ccac07680291f5845e5da806 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 6 Jul 2017 16:27:48 -0400 Subject: [PATCH 9/9] lib: fix more docstrings Signed-off-by: Quentin Young --- lib/agentx.c | 6 ++---- lib/command.c | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/agentx.c b/lib/agentx.c index 08cd650153..d058779aff 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -175,8 +175,7 @@ config_write_agentx (struct vty *vty) DEFUN (agentx_enable, agentx_enable_cmd, "agentx", - "SNMP AgentX protocol settings\n" - "SNMP AgentX settings\n") + "SNMP AgentX protocol settings\n") { if (!agentx_enabled) { @@ -194,8 +193,7 @@ DEFUN (no_agentx, no_agentx_cmd, "no agentx", NO_STR - "SNMP AgentX protocol settings\n" - "SNMP AgentX settings\n") + "SNMP AgentX protocol settings\n") { if (!agentx_enabled) return CMD_SUCCESS; vty_outln (vty, "SNMP AgentX support cannot be disabled once enabled"); diff --git a/lib/command.c b/lib/command.c index de8899687c..5ca4a0fda9 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2200,7 +2200,6 @@ DEFUN (no_config_log_file, "Logging control\n" "Cancel logging to file\n" "Logging file name\n" - "Logging file name\n" "Logging level\n") { zlog_reset_file ();