mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-26 23:23:35 +00:00
bgpd: rename reflect in subgroup_announce_check
In subgroup_announce_check(), the variable reflect is misleading, as it suggests a relation to route reflection. However, it actually refers to the scenario where an iBGP peer announces a route to another iBGP peer. Rename reflect to ibgp_to_ibgp. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
parent
d1433ee9a8
commit
4ae65cc21e
@ -2148,7 +2148,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
|
|||||||
struct attr *piattr;
|
struct attr *piattr;
|
||||||
route_map_result_t ret;
|
route_map_result_t ret;
|
||||||
int transparent;
|
int transparent;
|
||||||
int reflect;
|
int ibgp_to_ibgp;
|
||||||
afi_t afi;
|
afi_t afi;
|
||||||
safi_t safi;
|
safi_t safi;
|
||||||
int samepeer_safe = 0; /* for synthetic mplsvpns routes */
|
int samepeer_safe = 0; /* for synthetic mplsvpns routes */
|
||||||
@ -2357,14 +2357,14 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Route-Reflect check. */
|
/* iBGP to iBGP check. */
|
||||||
if (from->sort == BGP_PEER_IBGP && peer->sort == BGP_PEER_IBGP)
|
if (from->sort == BGP_PEER_IBGP && peer->sort == BGP_PEER_IBGP)
|
||||||
reflect = 1;
|
ibgp_to_ibgp = 1;
|
||||||
else
|
else
|
||||||
reflect = 0;
|
ibgp_to_ibgp = 0;
|
||||||
|
|
||||||
/* IBGP reflection check. */
|
/* IBGP reflection check. */
|
||||||
if (reflect && !samepeer_safe) {
|
if (ibgp_to_ibgp && !samepeer_safe) {
|
||||||
/* A route from a Client peer. */
|
/* A route from a Client peer. */
|
||||||
if (CHECK_FLAG(from->af_flags[afi][safi],
|
if (CHECK_FLAG(from->af_flags[afi][safi],
|
||||||
PEER_FLAG_REFLECTOR_CLIENT)) {
|
PEER_FLAG_REFLECTOR_CLIENT)) {
|
||||||
@ -2410,8 +2410,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
|
|||||||
|
|
||||||
/* If originator-id is not set and the route is to be reflected,
|
/* If originator-id is not set and the route is to be reflected,
|
||||||
set the originator id */
|
set the originator id */
|
||||||
if (reflect
|
if (ibgp_to_ibgp && (!(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID)))) {
|
||||||
&& (!(attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID)))) {
|
|
||||||
IPV4_ADDR_COPY(&(attr->originator_id), &(from->remote_id));
|
IPV4_ADDR_COPY(&(attr->originator_id), &(from->remote_id));
|
||||||
SET_FLAG(attr->flag, BGP_ATTR_ORIGINATOR_ID);
|
SET_FLAG(attr->flag, BGP_ATTR_ORIGINATOR_ID);
|
||||||
}
|
}
|
||||||
@ -2444,7 +2443,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
|
|||||||
* announced to an EBGP peer (and they have the same attributes barring
|
* announced to an EBGP peer (and they have the same attributes barring
|
||||||
* their nexthop).
|
* their nexthop).
|
||||||
*/
|
*/
|
||||||
if (reflect)
|
if (ibgp_to_ibgp)
|
||||||
SET_FLAG(attr->rmap_change_flags, BATTR_REFLECTED);
|
SET_FLAG(attr->rmap_change_flags, BATTR_REFLECTED);
|
||||||
|
|
||||||
#define NEXTHOP_IS_V6 \
|
#define NEXTHOP_IS_V6 \
|
||||||
@ -2472,7 +2471,7 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
|
|||||||
*/
|
*/
|
||||||
if (IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local))
|
if (IN6_IS_ADDR_LINKLOCAL(&attr->mp_nexthop_local))
|
||||||
global_and_ll = true;
|
global_and_ll = true;
|
||||||
} else if (!reflect && !transparent &&
|
} else if (!ibgp_to_ibgp && !transparent &&
|
||||||
IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) && peer->shared_network &&
|
IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_local) && peer->shared_network &&
|
||||||
(from == bgp->peer_self || peer->sort == BGP_PEER_EBGP))
|
(from == bgp->peer_self || peer->sort == BGP_PEER_EBGP))
|
||||||
global_and_ll = true;
|
global_and_ll = true;
|
||||||
@ -2694,9 +2693,8 @@ bool subgroup_announce_check(struct bgp_dest *dest, struct bgp_path_info *pi,
|
|||||||
PEER_FLAG_NEXTHOP_SELF)
|
PEER_FLAG_NEXTHOP_SELF)
|
||||||
|| CHECK_FLAG(peer->af_flags[afi][safi],
|
|| CHECK_FLAG(peer->af_flags[afi][safi],
|
||||||
PEER_FLAG_FORCE_NEXTHOP_SELF)) {
|
PEER_FLAG_FORCE_NEXTHOP_SELF)) {
|
||||||
if (!reflect
|
if (!ibgp_to_ibgp ||
|
||||||
|| CHECK_FLAG(peer->af_flags[afi][safi],
|
CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_FORCE_NEXTHOP_SELF)) {
|
||||||
PEER_FLAG_FORCE_NEXTHOP_SELF)) {
|
|
||||||
subgroup_announce_reset_nhop(
|
subgroup_announce_reset_nhop(
|
||||||
(peer_cap_enhe(peer, afi, safi)
|
(peer_cap_enhe(peer, afi, safi)
|
||||||
? AF_INET6
|
? AF_INET6
|
||||||
|
Loading…
Reference in New Issue
Block a user