From c9d5bd27c10b620571985ffc99e839883f9a7551 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 15 Dec 2016 21:28:51 -0500 Subject: [PATCH] bgpd: Fix 'show ip bgp summary' variable output being wrong The first time through calling 'show ip bgp summary' we were always calculating the variable hostname field size incorrectly. Signed-off-by: Donald Sharp --- bgpd/bgp_vty.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 5dafac1e06..b0d96150a8 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -10317,6 +10317,10 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, if (peer->afc[afi][safi]) { + memset(dn_flag, '\0', sizeof(dn_flag)); + if (peer_dynamic_neighbor(peer)) + dn_flag[0] = '*'; + if (peer->hostname && bgp_flag_check(bgp, BGP_FLAG_SHOW_HOSTNAME)) sprintf(neighbor_buf, "%s%s(%s) ", dn_flag, peer->hostname, peer->host); else