diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2024-08-28 23:43:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-28 23:43:40 -0400 |
| commit | ffaa365cc4c4880445d0f51828a458d1a43a4711 (patch) | |
| tree | 0973d25f364b2a6e1bfb121ce9d4c6dfe0f4b7d9 | |
| parent | 216ed8c7963137a077389a95ee9bc46dab4e0888 (diff) | |
| parent | 184dccca6001ca566788e3a51d2da4248f379f92 (diff) | |
Merge pull request #16681 from donaldsharp/zebra_re_after_rn
zebra: Move prefix lookup to outside re loop
| -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); |
