]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Simplify the code for show command 12963/head
authoranlan_cs <vic.lan@pica8.com>
Tue, 7 Mar 2023 00:50:00 +0000 (08:50 +0800)
committeranlan_cs <vic.lan@pica8.com>
Wed, 8 Mar 2023 08:10:05 +0000 (16:10 +0800)
Keep the common code for command: "show ip bgp summary [wide]".

Signed-off-by: anlan_cs <vic.lan@pica8.com>
bgpd/bgp_vty.c

index a1e9a9a8a94b1e976bf6c15379afd59ccb837b21..93b412240aadc8275af29c5503f87dd9eb931a27 100644 (file)
@@ -11676,37 +11676,22 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
                                vty_out(vty, "4 ");
                                vty_out(vty, ASN_FORMAT_SPACE(bgp->asnotation),
                                        &peer->as);
-                               if (show_wide) {
+                               if (show_wide)
                                        vty_out(vty,
                                                ASN_FORMAT_SPACE(
                                                        bgp->asnotation),
                                                peer->change_local_as
                                                        ? &peer->change_local_as
                                                        : &peer->local_as);
-                                       vty_out(vty,
-                                               " %9u %9u %8" PRIu64
-                                               " %4zu %4zu %8s",
-                                               PEER_TOTAL_RX(peer),
-                                               PEER_TOTAL_TX(peer),
-                                               peer->version[afi][safi],
-                                               inq_count, outq_count,
-                                               peer_uptime(peer->uptime,
-                                                           timebuf,
-                                                           BGP_UPTIME_LEN, 0,
-                                                           NULL));
-                               } else {
-                                       vty_out(vty,
-                                               " %9u %9u %8" PRIu64
-                                               " %4zu %4zu %8s",
-                                               PEER_TOTAL_RX(peer),
-                                               PEER_TOTAL_TX(peer),
-                                               peer->version[afi][safi],
-                                               inq_count, outq_count,
-                                               peer_uptime(peer->uptime,
-                                                           timebuf,
-                                                           BGP_UPTIME_LEN, 0,
-                                                           NULL));
-                               }
+                               vty_out(vty,
+                                       " %9u %9u %8" PRIu64 " %4zu %4zu %8s",
+                                       PEER_TOTAL_RX(peer),
+                                       PEER_TOTAL_TX(peer),
+                                       peer->version[afi][safi], inq_count,
+                                       outq_count,
+                                       peer_uptime(peer->uptime, timebuf,
+                                                   BGP_UPTIME_LEN, 0, NULL));
+
                                if (peer_established(peer)) {
                                        if (peer->afc_recv[afi][safi]) {
                                                if (CHECK_FLAG(