CVSROOT:        /cvs
Module name:    src
Changes by:     clau...@cvs.openbsd.org 2022/07/07 13:46:38

Modified files:
        usr.sbin/bgpd  : rde_decide.c 

Log message:
Rework prefix_insert() and prefix_remove() to properly recalculate dmetric

The med regress test triggered the fatal in prefix_set_dmetric() because
on MED priority inversion the simple check previous with next before remove
can return a negative number because that prefix is also inversed.

Adjust code so that when removing prefixes from the list wait until the
next element is checked to do the fixup. In prefix_remove() cache the
previous element and calculate the dmetric at the end of the MED check.
In prefix_insert() alter the loop to also defer the dmetric recalc by
removing most continue statements in the loop.
With and OK tb@

Reply via email to