From 843770f609a227a8df8203c5d6536b9f031bc214 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 21 Jan 2022 23:31:58 +0200 Subject: [PATCH] bgpd: Show negative form of capability extended-nexthop for interface peers ``` exit1-debian-11(config-router)# neighbor 192.168.100.3 remote-as external exit1-debian-11(config-router)# do sh run | include extended exit1-debian-11(config-router)# neighbor 192.168.100.3 capability extended-nexthop exit1-debian-11(config-router)# do sh run | include extended neighbor 192.168.100.3 capability extended-nexthop exit1-debian-11(config-router)# no neighbor 192.168.100.3 capability extended-nexthop exit1-debian-11(config-router)# do sh run | include extended exit1-debian-11(config-router)# neighbor eth0 interface remote-as external exit1-debian-11(config-router)# do sh run | include extended exit1-debian-11(config-router)# neighbor eth0 capability extended-nexthop exit1-debian-11(config-router)# do sh run | include extended exit1-debian-11(config-router)# no neighbor eth0 capability extended-nexthop exit1-debian-11(config-router)# do sh run | include extended no neighbor eth0 capability extended-nexthop exit1-debian-11(config-router)# ``` Signed-off-by: Donatas Abraitis --- bgpd/bgp_vty.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index e07883865a..6a37ed31c0 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -16547,17 +16547,14 @@ static void bgp_config_write_peer_global(struct vty *vty, struct bgp *bgp, /* capability extended-nexthop */ if (peergroup_flag_check(peer, PEER_FLAG_CAPABILITY_ENHE)) { - if (!peer->conf_if) { - if (CHECK_FLAG(peer->flags_invert, - PEER_FLAG_CAPABILITY_ENHE)) - vty_out(vty, - " no neighbor %s capability extended-nexthop\n", - addr); - else - vty_out(vty, - " neighbor %s capability extended-nexthop\n", - addr); - } + if (CHECK_FLAG(peer->flags_invert, PEER_FLAG_CAPABILITY_ENHE)) + vty_out(vty, + " no neighbor %s capability extended-nexthop\n", + addr); + else if (!peer->conf_if) + vty_out(vty, + " neighbor %s capability extended-nexthop\n", + addr); } /* dont-capability-negotiation */