summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-22 14:39:32 +0100
committerMaria Matejka <mq@ucw.cz>2022-04-06 18:14:08 +0200
commitdabd7bccb3b9e2b7482cf4ae7619a67559f3ac94 (patch)
treeec73a30bf6b6f44827fe21c4a02ca61756dc3d22 /proto
parent4a23ede2b056a41456790cc20a0c3d92a7137693 (diff)
BGP: Fixed LLGR depreferencing in bgp_rte_mergable
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/attrs.c7
1 files changed, 5 insertions, 2 deletions
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));