CVS: cvs.openbsd.org: src
Claudio Jeker <[email protected]>
| Newsgroups | gmane.os.openbsd.cvs |
|---|---|
| Message-ID | <[email protected]> |
CVSROOT: /cvs Module name: src Changes by: [email protected] 2026/07/13 06:27:34 Modified files: usr.sbin/bgpd : rde.h rde_adjout.c rde_peer.c rde_update.c Log message: Remove adjout_prefix_free() and its use in adjout_prefix_unlink() instead use tombstones in the adjout array for empty/unlinked entries and collect them later via adjout_prefix_collect(). adjout_prefix_first() and adjout_prefix_next() return direct pointers into the adjout prefix array and adjout_prefix_free() reshuffles entries so the pointers returned by first/next are no longer valid. By using tombstones the array pointers remain intact and it is possible to walk the array. Once done with the pt_entry adjout_prefix_collect() is called and it will collect all tombstones. Again after calling adjout_prefix_collect() any pointer into the adjout array is most probably invalid. While this solves the problem with prefix withdraw it does not solve addition of new entries. The good thing is that there is no code path that would require such an operation. On top of this the adjout_prefix_dump_r() has to walk all prefixes since that is what the callbacks expect. With the tombstones this is now safe. With and OK tb@