From: Theo Buehler Subject: Re: bgpd: drop PREFIX_ADJOUT_FLAG_STALE use To: tech@openbsd.org Date: Mon, 15 Dec 2025 06:10:24 +0100 On Sun, Dec 14, 2025 at 11:05:08AM +0100, Claudio Jeker wrote: > up_generate_addpath() is the only user of PREFIX_ADJOUT_FLAG_STALE. > > Instead of marking prefixes with PREFIX_ADJOUT_FLAG_STALE > up_generate_addpath() can use a local array of path ids to track which > paths were present at the start of the call, clear the path id during > updates and then add then end remove all paths that are still present in > the list. > > While this does a lot of linear walks I doubt this matters. The number of > paths is normally very small and so this linear search is all cached. > It is possible to further optimize this by also tracking the adjout_prefix > pointer to drop the adjout_prefix_get() call at the end. > > This also uses a fixed maximum of 2000 paths which is more than a > magnitude more than the amount the nlnog looking glass needs. Which is > AFAIK the biggest system using addpath. Normally people will limit the > amounts of selected paths to a handful. Reads fine and if it helps you move forward it looks like a decent enough tradeoff. ok tb