BGP: Fixed LLGR depreferencing in bgp_rte_mergable

This commit is contained in:
Maria Matejka 2022-03-22 14:39:32 +01:00
parent 4a23ede2b0
commit dabd7bccb3

View file

@ -2074,14 +2074,17 @@ bgp_rte_mergable(rte *pri, rte *sec)
u32 p, s; u32 p, s;
/* Skip suppressed routes (see bgp_rte_recalculate()) */ /* Skip suppressed routes (see bgp_rte_recalculate()) */
/* LLGR draft - depreference stale routes */ if ((pri->pflags ^ sec->pflags) & BGP_REF_SUPPRESSED)
if (pri->pflags != sec->pflags)
return 0; return 0;
/* RFC 4271 9.1.2.1. Route resolvability test */ /* RFC 4271 9.1.2.1. Route resolvability test */
if (rte_resolvable(pri) != rte_resolvable(sec)) if (rte_resolvable(pri) != rte_resolvable(sec))
return 0; return 0;
/* LLGR draft - depreference stale routes */
if (rte_stale(pri) != rte_stale(sec))
return 0;
/* Start with local preferences */ /* Start with local preferences */
x = ea_find(pri->attrs->eattrs, EA_CODE(PROTOCOL_BGP, BA_LOCAL_PREF)); 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)); y = ea_find(sec->attrs->eattrs, EA_CODE(PROTOCOL_BGP, BA_LOCAL_PREF));