summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2022-11-17 03:58:09 +0100
committerGitHub <noreply@github.com>2022-11-17 03:58:09 +0100
commit0fcf26b172e3cded767a4906904b76024b7e36f7 (patch)
tree6badf45c5ecad2022ae1ec4d0de0e13cd7fd2631
parentMerge pull request #11992 from pguibert6WIND/pathd_debug (diff)
parentbgpd: authorise to select bgp self peer prefix on rr case (diff)
downloadfrr-0fcf26b172e3cded767a4906904b76024b7e36f7.tar.xz
frr-0fcf26b172e3cded767a4906904b76024b7e36f7.zip
Merge pull request #12312 from pguibert6WIND/bgp_lu_rr_case
bgpd: authorise to select bgp self peer prefix on rr case
-rw-r--r--bgpd/bgp_route.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 130a0b4ab..a6a67eeaa 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4044,6 +4044,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
int vnc_implicit_withdraw = 0;
#endif
int same_attr = 0;
+ const struct prefix *bgp_nht_param_prefix;
/* Special case for BGP-LU - map LU safi to ordinary unicast safi */
if (orig_safi == SAFI_LABELED_UNICAST)
@@ -4111,6 +4112,11 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
if (aspath_get_last_as(attr->aspath) == bgp->as)
do_loop_check = 0;
+ if (CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_REFLECTOR_CLIENT))
+ bgp_nht_param_prefix = NULL;
+ else
+ bgp_nht_param_prefix = p;
+
/* AS path loop check. */
if (do_loop_check) {
if (aspath_loop_check(attr->aspath, bgp->as) > allowas_in ||
@@ -4621,8 +4627,8 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
if (bgp_find_or_add_nexthop(bgp, bgp_nexthop, nh_afi,
safi, pi, NULL, connected,
- p)
- || CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD))
+ bgp_nht_param_prefix) ||
+ CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD))
bgp_path_info_set_flag(dest, pi,
BGP_PATH_VALID);
else {
@@ -4784,8 +4790,8 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
nh_afi = BGP_ATTR_NH_AFI(afi, new->attr);
if (bgp_find_or_add_nexthop(bgp, bgp, nh_afi, safi, new, NULL,
- connected, p)
- || CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD))
+ connected, bgp_nht_param_prefix) ||
+ CHECK_FLAG(peer->flags, PEER_FLAG_IS_RFAPI_HD))
bgp_path_info_set_flag(dest, new, BGP_PATH_VALID);
else {
if (BGP_DEBUG(nht, NHT)) {