CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2026/05/28 03:10:22

Modified files:
        usr.sbin/bgpd  : rde.c rde.h rde_adjout.c rde_peer.c 
                         rde_update.c 

Log message:
Adjust the adjout_prefix_dump walker to operate using the adjout_bid
and stop using peer_get() in the walker.

This fixes the peer_reaper walker which before this was not working
at all. The peer reaper removed the peer from the RB tree before walking
the table and so peer_get() would return NULL and abort the walk immediatly.

Adjust the adjout_prefix_dump context to use the adjout_bid and stop using
peer->conf.id and peer_get.

To make this work the following changes are needed:
- For the callback drop the struct rde_peer argument instead add a uint32_t
bid argument.
- adjout_prefix_first() also needs to switch to using the adjout bitmask id
instead of using the peer directly.
- also change adjout_prefix_next() just to be in sync with
adjout_prefix_first()
- In most callbacks use the arg pointer to pass in the peer
- Adjust rde_dump_ctx_new() and rde_dump_adjout_upcall(). The latter now
calls peer_get() using the struct rde_dump_ctx peerid for that.
rde_dump_ctx_new() needs some fixes so that peerid and adjout_bid remain
in sync.
- In adjout_prefix_dump_r() check if adjout_bid is 0 and abort the walk if
so. Doing this check in adjout_prefix_dump_new() is tricky since most
code does not expect the done callback to be run that early.

OK tb@

Reply via email to