draft-uttaro-idr-bgp-persistence-04 mandates that routes tagged
with LLGR_STALE are to be used as routes of least preference.
Teach best path selection about this use it as the first step
of discrimination: depreferenced paths will always lose to
non-depreferenced paths.
JIRA: BGPCEP-495
Change-Id: I81a1ba1d09c554dee754329b5a907fbff3d6bf84
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
* @return true if the existing path is better, false if the new path is better
*/
protected boolean isExistingPathBetter(@Nonnull final BestPathState state) {
+ // 0. draft-uttaro-idr-bgp-persistence-04 defines "depreferenced" paths
+ final boolean stateDepref = state.isDepreferenced();
+ if (this.bestState.isDepreferenced() != stateDepref) {
+ return stateDepref;
+ }
+
// 1. prefer path with accessible nexthop
// - we assume that all nexthops are accessible
/*