From 19a85c68bf387479c99b1f482a10316e3b534242 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Sun, 1 Sep 2024 22:35:22 +0300 Subject: [PATCH] bgpd: Do not send route-refresh if it wasn't negotiated in capabilities Fixes: 04dfcb14ff9a02b053dfed0b3f657c6643d73830 ("bgpd: Deprecate Prestandard Route Refresh capability (128)") Signed-off-by: Donatas Abraitis --- bgpd/bgp_packet.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 2a2c9bdba996..fa03f1d21de5 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -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);