]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: show bgp ipv4 label-unicast does not provide any output
authorDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 13 Jul 2017 15:17:15 +0000 (15:17 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 13 Jul 2017 15:17:15 +0000 (15:17 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
bgpd/bgp_route.c
bgpd/bgp_vty.c

index 62edf982c3e6fd8f2dd8b529fb1f494faf0a64ee..9fc952180e8942e949dbe4198cb9b4ccdf334e31 100644 (file)
@@ -9182,21 +9182,25 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi)
 {
   struct bgp_table_stats ts;
   unsigned int i;
-  
+
   if (!bgp->rib[afi][safi])
     {
       vty_outln (vty, "%% No RIB exist's for the AFI(%d)/SAFI(%d)",
               afi, safi);
       return CMD_WARNING;
     }
-  
+
+  vty_outln (vty, "BGP %s RIB statistics%s",
+           afi_safi_print (afi, safi), VTYNL);
+
+  /* labeled-unicast routes live in the unicast table */
+  if (safi == SAFI_LABELED_UNICAST)
+    safi = SAFI_UNICAST;
+
   memset (&ts, 0, sizeof (ts));
   ts.table = bgp->rib[afi][safi];
   thread_execute (bm->master, bgp_table_stats_walker, &ts, 0);
 
-  vty_outln (vty, "BGP %s RIB statistics%s",
-           afi_safi_print (afi, safi), VTYNL);
-  
   for (i = 0; i < BGP_STATS_MAX; i++)
     {
       if (!table_stats_strs[i])
@@ -9968,10 +9972,6 @@ static int
 bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
                         safi_t safi, enum bgp_show_type type, u_char use_json)
 {
-  /* labeled-unicast routes live in the unicast table */
-  if (safi == SAFI_LABELED_UNICAST)
-    safi = SAFI_UNICAST;
-
   if (! peer || ! peer->afc[afi][safi])
     {
       if (use_json)
@@ -9987,6 +9987,10 @@ bgp_show_neighbor_route (struct vty *vty, struct peer *peer, afi_t afi,
       return CMD_WARNING;
     }
 
+  /* labeled-unicast routes live in the unicast table */
+  if (safi == SAFI_LABELED_UNICAST)
+    safi = SAFI_UNICAST;
+
   return bgp_show (vty, peer->bgp, afi, safi, type, &peer->su, use_json);
 }
 
index 710aa926ad411e2ecebc3b982a61fa7a88751889..c244a68b7b1f1f616119269cf630d4da2512632d 100644 (file)
@@ -6815,9 +6815,18 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
   int neighbor_col_default_width = 16;
   int len;
   int max_neighbor_width = 0;
+  int pfx_rcd_safi;
   json_object *json_peer = NULL;
   json_object *json_peers = NULL;
 
+  /* labeled-unicast routes are installed in the unicast table so in order to
+   * display the correct PfxRcd value we must look at SAFI_UNICAST
+   */
+  if (safi == SAFI_LABELED_UNICAST)
+    pfx_rcd_safi = SAFI_UNICAST;
+  else
+    pfx_rcd_safi = safi;
+
   if (use_json)
     {
       if (json == NULL)
@@ -7050,7 +7059,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
               json_object_int_add(json_peer, "outq", peer->obuf->count);
               json_object_int_add(json_peer, "inq", 0);
               peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN, use_json, json_peer);
-              json_object_int_add(json_peer, "prefixReceivedCount", peer->pcount[afi][safi]);
+              json_object_int_add(json_peer, "prefixReceivedCount", peer->pcount[afi][pfx_rcd_safi]);
 
               if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))
                 json_object_string_add(json_peer, "state", "Idle (Admin)");
@@ -7101,7 +7110,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi,
                        peer_uptime (peer->uptime, timebuf, BGP_UPTIME_LEN, 0, NULL));
 
               if (peer->status == Established)
-                  vty_out (vty, " %12ld", peer->pcount[afi][safi]);
+                  vty_out (vty, " %12ld", peer->pcount[afi][pfx_rcd_safi]);
               else
                 {
                   if (CHECK_FLAG (peer->flags, PEER_FLAG_SHUTDOWN))