summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
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);
}