mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 15:07:51 +00:00
bgpd: Clear addpath RX flag if it's absent
When we have RX/TX flags, but received only TX, we should clear RX flag, to avoid receiving additional paths. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
373d46d0f7
commit
058f3ff7ad
@ -709,14 +709,16 @@ static int bgp_capability_addpath(struct peer *peer,
|
||||
uint8_t send_receive = stream_getc(s);
|
||||
|
||||
if (bgp_debug_neighbor_events(peer))
|
||||
zlog_debug(
|
||||
"%s OPEN has %s capability for afi/safi: %s/%s%s%s",
|
||||
zlog_debug("%s OPEN has %s capability for afi/safi: %s/%s%s%s",
|
||||
peer->host,
|
||||
lookup_msg(capcode_str, hdr->code, NULL),
|
||||
iana_afi2str(pkt_afi), iana_safi2str(pkt_safi),
|
||||
(send_receive & BGP_ADDPATH_RX) ? ", receive"
|
||||
iana_afi2str(pkt_afi),
|
||||
iana_safi2str(pkt_safi),
|
||||
CHECK_FLAG(send_receive, BGP_ADDPATH_RX)
|
||||
? ", receive"
|
||||
: "",
|
||||
(send_receive & BGP_ADDPATH_TX) ? ", transmit"
|
||||
CHECK_FLAG(send_receive, BGP_ADDPATH_TX)
|
||||
? ", transmit"
|
||||
: "");
|
||||
|
||||
/* Convert AFI, SAFI to internal values, check. */
|
||||
@ -736,13 +738,19 @@ static int bgp_capability_addpath(struct peer *peer,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (send_receive & BGP_ADDPATH_RX)
|
||||
if (CHECK_FLAG(send_receive, BGP_ADDPATH_RX))
|
||||
SET_FLAG(peer->af_cap[afi][safi],
|
||||
PEER_CAP_ADDPATH_AF_RX_RCV);
|
||||
else
|
||||
UNSET_FLAG(peer->af_cap[afi][safi],
|
||||
PEER_CAP_ADDPATH_AF_RX_RCV);
|
||||
|
||||
if (send_receive & BGP_ADDPATH_TX)
|
||||
if (CHECK_FLAG(send_receive, BGP_ADDPATH_TX))
|
||||
SET_FLAG(peer->af_cap[afi][safi],
|
||||
PEER_CAP_ADDPATH_AF_TX_RCV);
|
||||
else
|
||||
UNSET_FLAG(peer->af_cap[afi][safi],
|
||||
PEER_CAP_ADDPATH_AF_TX_RCV);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user