Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: bgpd: fix error handling PREFIX_FLAG_FILTERED
To:
tech@openbsd.org
Date:
Mon, 4 May 2026 21:30:36 +0200

Download raw body.

Thread
On Mon, May 04, 2026 at 09:15:11PM +0200, Claudio Jeker wrote:
> With the introduction of 'rde rib Loc-RIB include filtered' it is possible
> that prefixes change prefix_eligible() outcome without a change of
> attributes or nexthop. This happens when new filters are installed.
>  
> In prefix_update() this takes a shortcut path but that path is missing a
> call to prefix_evaluate() to ensure that if the filtered flag changes an
> update is forced.
> 
> Below is my try to fix this. If the filtered state changed, toggle the
> PREFIX_FLAG_FILTERED bit and then call prefix_evaluate(). If the filtered
> flag is in sync with filtered then this can be skipped.

That makes sense.

ok

> I used p_filtered to be 0 or 1 and check against !filtered (to ensure that
> this value is also 0 or 1). I hope that's not too much magic...

The magic seems fine. I wouldn't mind normalizing filtered = !!filtered;
at the top, so the check could become if (p_filtered != filtered), which
I find more readable, but we tend to avoid !! in our tree for some reason.