From 655f79c9d2352c4c57b883aad0da6cd4528f4dde Mon Sep 17 00:00:00 2001 From: Dinesh G Dutt Date: Wed, 6 Jul 2016 06:50:23 -0700 Subject: [PATCH] Don't print 'neighbor activate' if its default for IPv4 unicast AFI/SAFI Ticket: CM-11460 Reviewed By: CCR-4927 Testing Done: Quagga's default "show running" model is to only print the non-default config. Historically, IPv4 unicast has always had a default 'activate' model unless its been configured otherwise. In 3.0, we introduced a print of the 'activate' statement for IPv4 unicast independent of whether it was the default or not. This causes quagga reload to break as the user doesn't configure 'activate' for IPv4 unicast, and so any config changes will also not have it. However 'show running' will display it, causing quagga reload to think that the AFI/SAFI has been deactivated and bounce the sessions incorrectly. This patch reverts to the original quagga behavior/model of not printing the 'activate' line for IPv4 unicast if its the default. --- bgpd/bgpd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index f23cc13725..ca72d2403a 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -6621,9 +6621,17 @@ bgp_config_write_peer_af (struct vty *vty, struct bgp *bgp, { if (peer->afc[afi][safi]) { - afi_header_vty_out (vty, afi, safi, write, - " neighbor %s activate%s", - addr, VTY_NEWLINE); + if ((afi == AFI_IP) && (safi == SAFI_UNICAST)) + { + if (bgp_flag_check (bgp, BGP_FLAG_NO_DEFAULT_IPV4)) + { + vty_out (vty, " neighbor %s activate%s", addr, VTY_NEWLINE); + } + } + else + afi_header_vty_out (vty, afi, safi, write, + " neighbor %s activate%s", + addr, VTY_NEWLINE); } } -- 2.39.5