Commit 1ac4d21307 for frr
commit 1ac4d21307231dfff7ab76e0fbdb1ce8b3697723
Author: Nageswara Soma <nsoma@cisco.com>
Date: Sun Nov 22 13:10:09 2026 -0800
bgpd: fix EoRR deleting routes restored mid-refresh
During enhanced refresh, returning to the last packed
attributes still cancels a queued different update or
withdrawal. If the route has not been sent since BoRR,
EoRR then removes its stale copy at the receiver.
Check live subgroup peers for an active refresh before
suppressing that advertisement. Queue the current
attributes until EoRR, while keeping matching queued
replies and normal cancellation outside refresh.
Only scan peers when queued state could be canceled.
Signed-off-by: Nageswara Soma <nsoma@cisco.com>
diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c
index 5fdeef53fc..938aefb307 100644
--- a/bgpd/bgp_updgrp_adv.c
+++ b/bgpd/bgp_updgrp_adv.c
@@ -551,6 +551,7 @@ bool bgp_adj_out_set_subgroup(struct bgp_dest *dest,
struct bgp *bgp;
struct attr *attr_new;
bool debug;
+ bool refresh_pending = false;
struct bgp_debug_vrf dv = {
.name = "Unknown",
.id = VRF_UNKNOWN,
@@ -599,8 +600,23 @@ bool bgp_adj_out_set_subgroup(struct bgp_dest *dest,
*/
attr_new = bgp_attr_intern(attr);
+ /* The refresh walk clears FORCE_UPDATES before its replies are packed.
+ * Until EoRR, the last packed attributes may still predate BoRR. Replace
+ * a queued withdraw or different update even when returning to those
+ * attributes. Refresh state belongs to live peers, not the group config.
+ */
+ if (adj->adv && attr_new == adj->attr &&
+ (!adj->adv->baa || attr_new != adj->adv->baa->attr)) {
+ SUBGRP_FOREACH_PEER (subgrp, paf) {
+ if (CHECK_FLAG(PAF_PEER(paf)->af_sflags[afi][safi], PEER_STATUS_BORR_SEND)) {
+ refresh_pending = true;
+ break;
+ }
+ }
+ }
+
if (CHECK_FLAG(bgp->flags, BGP_FLAG_SUPPRESS_DUPLICATES) &&
- !CHECK_FLAG(subgrp->sflags, SUBGRP_STATUS_FORCE_UPDATES) &&
+ !CHECK_FLAG(subgrp->sflags, SUBGRP_STATUS_FORCE_UPDATES) && !refresh_pending &&
((attr_new == adj->attr) ||
(adj->adv && adj->adv->baa && (attr_new == adj->adv->baa->attr))) &&
bgp_labels_cmp(path->extra ? path->extra->labels : NULL, adj->labels)) {