Skip to content

Commit

Permalink
bgpd: Do not send route-refresh if it wasn't negotiated in capabilities
Browse files Browse the repository at this point in the history
Fixes: 04dfcb1 ("bgpd: Deprecate Prestandard Route Refresh capability (128)")

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Sep 1, 2024
1 parent be161ba commit 19a85c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bgpd/bgp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,10 +1116,10 @@ void bgp_route_refresh_send(struct peer *peer, afi_t afi, safi_t safi,
s = stream_new(peer->max_packet_size);

/* Make BGP update packet. */
if (CHECK_FLAG(peer->cap, PEER_CAP_REFRESH_RCV))
bgp_packet_set_marker(s, BGP_MSG_ROUTE_REFRESH_NEW);
else
bgp_packet_set_marker(s, BGP_MSG_ROUTE_REFRESH_OLD);
if (!CHECK_FLAG(peer->cap, PEER_CAP_REFRESH_RCV))
return;

bgp_packet_set_marker(s, BGP_MSG_ROUTE_REFRESH_NEW);

/* Encode Route Refresh message. */
stream_putw(s, pkt_afi);
Expand Down

0 comments on commit 19a85c6

Please sign in to comment.