CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2022/09/12 04:03:17

Modified files:
        usr.sbin/bgpd  : rde.c rde.h rde_rib.c 

Log message:
Introduce tree walkers that only walk a subtree of the RIB.

In some cases only a "small" part of the RIB needs to be looked at. Like
bgpctl show rib 10/8 or-longer that only needs to travers nodes under
10/8 all other RIB entries do not matter. By setting the start node to
the RB_NFIND(10/8) the all nodes below this point can be skipped.
Using prefix_compare() while walking the tree with RB_NEXT() the walker
know when it steps outside of the 10/8 subtree and stops.
With this the or-longer commands become a lot faster.

Looks good to tb@

Reply via email to