]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: fix summary line reporting routes with RDs (no json case)
authorLou Berger <lberger@labn.net>
Fri, 12 Jan 2018 02:33:34 +0000 (21:33 -0500)
committerLou Berger <lberger@labn.net>
Fri, 12 Jan 2018 13:45:48 +0000 (08:45 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/bgp_route.c

index 81b605ad79f38addf7caa9ab5863afee0675cb48..ccccead3d7a9e980c09241b3de1a04ea8434844a 100644 (file)
@@ -8117,6 +8117,9 @@ int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
        struct bgp_node *rn, *next;
        unsigned long output_cum = 0;
        unsigned long total_cum = 0;
+       bool show_msg;
+
+       show_msg = (!use_json && type == bgp_show_type_normal);
 
        for (rn = bgp_table_top(table); rn; rn = next) {
                next = bgp_route_next(rn);
@@ -8132,8 +8135,19 @@ int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
                                       output_arg, use_json,
                                       rd, next == NULL,
                                       &output_cum, &total_cum);
+                       if (next == NULL)
+                               show_msg = false;
                }
        }
+       if (show_msg) {
+               if (output_cum == 0)
+                       vty_out(vty, "No BGP prefixes displayed, %ld exist\n",
+                               total_cum);
+               else
+                       vty_out(vty,
+                               "\nDisplayed  %ld routes and %ld total paths\n",
+                               output_cum, total_cum);
+       }
        if (use_json)
                vty_out(vty, " } }");
        return CMD_SUCCESS;