From b94ddf1f63f6a0b1956f6043760c3e5aec1da134 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 5 Feb 2024 10:55:22 +0200 Subject: [PATCH] bgpd: Send dynamic capability when on/off FQDN capability Signed-off-by: Donatas Abraitis --- bgpd/bgp_vty.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 09f9667a9a09..7259933f95af 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -5746,17 +5746,25 @@ DEFPY (neighbor_capability_fqdn, "Advertise fqdn capability to the peer\n") { struct peer *peer; + int ret; peer = peer_and_group_lookup_vty(vty, neighbor); if (!peer) return CMD_WARNING_CONFIG_FAILED; if (no) - return peer_flag_unset_vty(vty, neighbor, + ret = peer_flag_unset_vty(vty, neighbor, PEER_FLAG_CAPABILITY_FQDN); else - return peer_flag_set_vty(vty, neighbor, + ret = peer_flag_set_vty(vty, neighbor, PEER_FLAG_CAPABILITY_FQDN); + + bgp_capability_send(peer, AFI_IP, SAFI_UNICAST, + PEER_FLAG_CAPABILITY_FQDN, + no ? CAPABILITY_ACTION_UNSET + : CAPABILITY_ACTION_SET); + + return ret; } /* neighbor capability extended next hop encoding */