summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2018-01-12 03:33:34 +0100
committerLou Berger <lberger@labn.net>2018-01-12 14:45:48 +0100
commit0136788cd3685ab3f7c97aef1fb321b1862363a1 (patch)
treedbfeb1554633a960ea075b51e6bafbe4a4d972c4 /bgpd/bgp_route.c
parentMerge pull request #1609 from dwalton76/ospf-reconfigure-area (diff)
downloadfrr-0136788cd3685ab3f7c97aef1fb321b1862363a1.tar.xz
frr-0136788cd3685ab3f7c97aef1fb321b1862363a1.zip
bgpd: fix summary line reporting routes with RDs (no json case)
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r--bgpd/bgp_route.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 81b605ad7..ccccead3d 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -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;