summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-05-03 21:23:14 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-05-04 13:51:20 +0200
commitc4786405b5503277a4e6e05674eadcc389451a9e (patch)
treeea63c2efb21a5de1d554018bb0581dfdcbcbee8d /bgpd
parentbgpd: enhanced capability is always turned on for interface based peers (diff)
downloadfrr-c4786405b5503277a4e6e05674eadcc389451a9e.tar.xz
frr-c4786405b5503277a4e6e05674eadcc389451a9e.zip
bgpd: Refuse to let interfaced peering to change capability extended-nexthop
Do not interface based peers change anything about when a [no] neighbor <interface> capability extended-nexthop is entered. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_vty.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 5501ec46b..65a053990 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -5273,6 +5273,12 @@ DEFUN (neighbor_capability_enhe,
"Advertise extended next-hop capability to the peer\n")
{
int idx_peer = 1;
+ struct peer *peer;
+
+ peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
+ if (peer && peer->conf_if)
+ return CMD_SUCCESS;
+
return peer_flag_set_vty(vty, argv[idx_peer]->arg,
PEER_FLAG_CAPABILITY_ENHE);
}
@@ -5287,6 +5293,16 @@ DEFUN (no_neighbor_capability_enhe,
"Advertise extended next-hop capability to the peer\n")
{
int idx_peer = 2;
+ struct peer *peer;
+
+ peer = peer_and_group_lookup_vty(vty, argv[idx_peer]->arg);
+ if (peer && peer->conf_if) {
+ vty_out(vty,
+ "Peer %s cannot have capability extended-nexthop turned off\n",
+ argv[idx_peer]->arg);
+ return CMD_WARNING_CONFIG_FAILED;
+ }
+
return peer_flag_unset_vty(vty, argv[idx_peer]->arg,
PEER_FLAG_CAPABILITY_ENHE);
}