]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Fix output of interface based 'show bgp ..' commands
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 7 Jul 2017 13:08:25 +0000 (09:08 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 8 Aug 2017 14:28:54 +0000 (10:28 -0400)
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 <sharpd@cumulusnetworks.com>
bgpd/bgp_route.c

index 44e5af578dd9acbea3bc17eefaa9dc4c2cac8491..bce54ab2d0bcbfe9c132262d52b828696554cea4 100644 (file)
@@ -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,
                                                                " ");