Skip to content

Commit 047e685

Browse files
author
Mark Stapp
committed
zebra: only use vty yield/resume where supported
Ensure the common show code can tell when it's being used in a path that supports yield/resume; only yield when that's happening. Signed-off-by: Mark Stapp <mjs@cisco.com>
1 parent 8e43321 commit 047e685

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

zebra/zebra_vty.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
/* context to manage show output in multiple tables or vrfs */
5858
struct route_show_ctx {
5959
bool multi; /* dump multiple tables or vrf */
60+
bool all_vrf;
6061
bool header_done; /* common header already displayed */
6162
bool allocated; /* malloc'd (vs on-stack) */
6263

@@ -963,6 +964,7 @@ static int do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
963964
const struct prefix_ipv6 *src_pfx;
964965
const struct prefix *pfx;
965966
int ret = CMD_SUCCESS;
967+
bool do_yield = ctx->all_vrf; /* TODO -- remove this */
966968

967969
/*
968970
* ctx->multi indicates if we are dumping multiple tables or vrfs.
@@ -1062,7 +1064,7 @@ static int do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
10621064
}
10631065

10641066
/* Time to yield? */
1065-
if (ctx->curr_counter > show_yield_limit) {
1067+
if (do_yield && (ctx->curr_counter > show_yield_limit)) {
10661068
ctx->total_counter += ctx->curr_counter;
10671069
ctx->curr_counter = 0;
10681070

@@ -2092,6 +2094,7 @@ DEFPY (show_route,
20922094
0, !!ng, false, false, false, false, 0);
20932095

20942096
ctx.multi = (vrf_all || table_all);
2097+
ctx.all_vrf = true;
20952098

20962099
do_show_ip_route_all_ctx(vty, &ctx);
20972100
} else {

0 commit comments

Comments
 (0)