From 4192df64c9185b48d60deefac81927a25fb688a9 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 7 Jul 2017 09:08:25 -0400 Subject: [PATCH] bgpd: Fix output of interface based 'show bgp ..' commands When issuing a 'show ip bgp' command and the nexthop is a interface, if the interface name was greater than 7 characters we would arbitrarily start a new-line and setup the next line to start at the wrong spot. Modify the interface field to allow 16 characters than 7( to match v6 display ), and if the interface name is greater than 16 characters properly setup the next line for display Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 44e5af578d..bce54ab2d0 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6513,15 +6513,14 @@ void route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo, len = vty_out( vty, "%s", binfo->peer->conf_if); - len = - 7 - len; /* len of IPv6 - addr + max - len of def - ifname */ + len = 16 - len; /* len of IPv6 + addr + max + len of def + ifname */ if (len < 1) vty_out(vty, "\n%*s", - 45, " "); + 36, " "); else vty_out(vty, "%*s", len, " "); -- 2.39.5