From dabd7bccb3b9e2b7482cf4ae7619a67559f3ac94 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 22 Mar 2022 14:39:32 +0100 Subject: BGP: Fixed LLGR depreferencing in bgp_rte_mergable --- proto/bgp/attrs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'proto/bgp/attrs.c') diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 454686cf..a7c49be5 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -2074,14 +2074,17 @@ bgp_rte_mergable(rte *pri, rte *sec) u32 p, s; /* Skip suppressed routes (see bgp_rte_recalculate()) */ - /* LLGR draft - depreference stale routes */ - if (pri->pflags != sec->pflags) + if ((pri->pflags ^ sec->pflags) & BGP_REF_SUPPRESSED) return 0; /* RFC 4271 9.1.2.1. Route resolvability test */ if (rte_resolvable(pri) != rte_resolvable(sec)) return 0; + /* LLGR draft - depreference stale routes */ + if (rte_stale(pri) != rte_stale(sec)) + return 0; + /* Start with local preferences */ x = ea_find(pri->attrs->eattrs, EA_CODE(PROTOCOL_BGP, BA_LOCAL_PREF)); y = ea_find(sec->attrs->eattrs, EA_CODE(PROTOCOL_BGP, BA_LOCAL_PREF)); -- cgit v1.2.3