Skip to content

Commit 00baaab

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 afe88db commit 00baaab

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

@@ -861,6 +862,7 @@ static int do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf, struct
861862
const struct prefix_ipv6 *src_pfx;
862863
const struct prefix *pfx;
863864
int ret = CMD_SUCCESS;
865+
bool do_yield = ctx->all_vrf; /* TODO -- remove this */
864866

865867
/*
866868
* ctx->multi indicates if we are dumping multiple tables or vrfs.
@@ -955,7 +957,7 @@ static int do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf, struct
955957
}
956958

957959
/* Time to yield? */
958-
if (ctx->curr_counter > show_yield_limit) {
960+
if (do_yield && (ctx->curr_counter > show_yield_limit)) {
959961
ctx->total_counter += ctx->curr_counter;
960962
ctx->curr_counter = 0;
961963

@@ -1901,6 +1903,7 @@ DEFPY (show_route,
19011903
0, !!ng);
19021904

19031905
ctx.multi = (vrf_all || table_all);
1906+
ctx.all_vrf = true;
19041907

19051908
do_show_ip_route_all_ctx(vty, &ctx);
19061909
} else {

0 commit comments

Comments
 (0)