IP4_FIB stats API not indexing after FIB changes - VPP-951
[vpp.git] / src / vpp / stats / stats.c
index 38821da..b0fac73 100644 (file)
@@ -577,7 +577,6 @@ do_ip4_fibs (stats_main_t * sm)
   ip4_route_t *r;
   fib_table_t *fib;
   ip4_fib_t *v4_fib;
-  ip_lookup_main_t *lm = &im4->lookup_main;
   static uword *results;
   vl_api_vnet_ip4_fib_counters_t *mp = 0;
   u32 items_this_message;
@@ -648,9 +647,11 @@ again:
     vec_foreach (r, routes)
       {
         vlib_counter_t c;
+        const dpo_id_t *dpo_id;
 
+        dpo_id = fib_entry_contribute_ip_forwarding(r->index);
         vlib_get_combined_counter (&load_balance_main.lbm_to_counters,
-                                   r->index, &c);
+                                   (u32)dpo_id->dpoi_index, &c);
         /*
          * If it has actually
          * seen at least one packet, send it.