summaryrefslogtreecommitdiff
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 15:32:11 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 15:32:11 +0200
commit81aeccbb00bdc457c53bb8ab96715537513f7b2c (patch)
treebf35a54afc7d7df4b5a7fa0be022d4c540fd6c6e /proto/bgp/attrs.c
parentd7b077f5d63625beaca1bcfe971e3b853dbfcc06 (diff)
parentd39ef961d1dde230c55fcc931b53f44cb34a1e63 (diff)
Merge commit 'd39ef961d1dde230c55fcc931b53f44cb34a1e63' into haugesund
Diffstat (limited to 'proto/bgp/attrs.c')
-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 f4f7d15a..9f31c28b 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 (rta_resolvable(pri->attrs) != rta_resolvable(sec->attrs))
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));