summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/zebra_vty.c7
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);