diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-08-28 13:18:00 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-08-28 13:18:00 -0400 | 
| commit | 184dccca6001ca566788e3a51d2da4248f379f92 (patch) | |
| tree | c793cec0df8c17cb8453b2005e707747aaca83f9 /zebra/zebra_vty.c | |
| parent | 3d2c589766a7bd8694bcbdb8c6979178d1f2d811 (diff) | |
zebra: Move prefix lookup to outside re loop
Move the prefix lookup/comparison to outside the re loop
and into the rn loop, since that is where the code should
actually be.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 7 | 
1 files changed, 3 insertions, 4 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 5742c38e23..3b786e3257 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -891,6 +891,9 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,  	for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) {  		dest = rib_dest_from_rnode(rn); +		if (longer_prefix_p && !prefix_match(longer_prefix_p, &rn->p)) +			continue; +  		RNODE_FOREACH_RE (rn, re) {  			if (use_fib && re != dest->selected_fib)  				continue; @@ -898,10 +901,6 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,  			if (tag && re->tag != tag)  				continue; -			if (longer_prefix_p -			    && !prefix_match(longer_prefix_p, &rn->p)) -				continue; -  			/* This can only be true when the afi is IPv4 */  			if (supernets_only) {  				addr = ntohl(rn->p.u.prefix4.s_addr);  | 
