summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-05-24 07:50:49 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2024-05-24 09:35:43 +0200
commit150eb73054902511b4be78666ab9895a7509a4ce (patch)
tree72f678790731e9272c179dda95cb9af2c99de924 /bgpd
parentbgpd: Add sanity check for capability lengths before processing them (diff)
downloadfrr-150eb73054902511b4be78666ab9895a7509a4ce.tar.xz
frr-150eb73054902511b4be78666ab9895a7509a4ce.zip
bgpd: Send a notification if we receive CAPABILITY message if not exepected
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_packet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 47aed53bc..a32ee7886 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -3952,8 +3952,8 @@ int bgp_capability_receive(struct peer_connection *connection,
if (bgp_debug_neighbor_events(peer))
zlog_debug("%s rcv CAPABILITY", peer->host);
- /* If peer does not have the capability, send notification. */
- if (!CHECK_FLAG(peer->cap, PEER_CAP_DYNAMIC_ADV)) {
+ if (!CHECK_FLAG(peer->cap, PEER_CAP_DYNAMIC_ADV) ||
+ !CHECK_FLAG(peer->cap, PEER_CAP_DYNAMIC_RCV)) {
flog_err(EC_BGP_NO_CAP,
"%s [Error] BGP dynamic capability is not enabled",
peer->host);