Merge pull request #16127 from opensourcerouting/fix/eor_not_only_for_gr

bgpd: Send End-of-RIB not only if Graceful Restart capability is received
This commit is contained in:
Donald Sharp 2024-06-01 10:08:25 -04:00 committed by GitHub
commit 894e72895e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -560,41 +560,38 @@ void bgp_generate_updgrp_packets(struct event *thread)
} }
} }
if (CHECK_FLAG(peer->cap, /* rfc4724 says:
PEER_CAP_RESTART_RCV)) { * Although the End-of-RIB marker is
if (!(PAF_SUBGRP(paf))->t_coalesce * specified for the purpose of BGP
&& peer->afc_nego[afi][safi] * graceful restart, it is noted that
&& peer->synctime * the generation of such a marker upon
&& !CHECK_FLAG( * completion of the initial update would
peer->af_sflags[afi][safi], * be useful for routing convergence in
PEER_STATUS_EOR_SEND)) { * general, and thus the practice is
/* If EOR is disabled, * recommended.
* the message is not sent
*/ */
if (BGP_SEND_EOR(peer->bgp, afi, if (!(PAF_SUBGRP(paf))->t_coalesce &&
safi)) { peer->afc_nego[afi][safi] &&
SET_FLAG( peer->synctime &&
peer->af_sflags !CHECK_FLAG(peer->af_sflags[afi][safi],
[afi] PEER_STATUS_EOR_SEND)) {
[safi], /* If EOR is disabled, the message is
* not sent.
*/
if (!BGP_SEND_EOR(peer->bgp, afi, safi))
continue;
SET_FLAG(peer->af_sflags[afi][safi],
PEER_STATUS_EOR_SEND); PEER_STATUS_EOR_SEND);
/* Update EOR /* Update EOR send time */
* send time peer->eor_stime[afi][safi] =
*/
peer->eor_stime[afi]
[safi] =
monotime(NULL); monotime(NULL);
BGP_UPDATE_EOR_PKT( BGP_UPDATE_EOR_PKT(peer, afi, safi, s);
peer, afi, safi, bgp_process_pending_refresh(peer, afi,
s);
bgp_process_pending_refresh(
peer, afi,
safi); safi);
} }
}
}
continue; continue;
} }