fib_table_t *fib_table = fib_table_get(fib_index, FIB_PROTOCOL_IP6);
fib_source_t source;
- /*
+ /*
* validate no more routes.
*/
- ASSERT(0 == fib_table->ft_total_route_counts);
- FOR_EACH_FIB_SOURCE(source)
+#ifdef CLIB_DEBUG
+ if (0 != fib_table->ft_total_route_counts)
+ fib_table_assert_empty(fib_table);
+#endif
+
+ vec_foreach_index(source, fib_table->ft_src_route_counts)
{
ASSERT(0 == fib_table->ft_src_route_counts[source]);
}
{
hash_unset (ip6_main.fib_index_by_table_id, fib_table->ft_table_id);
}
+ vec_free(fib_table->ft_src_route_counts);
pool_put_index(ip6_main.v6_fibs, fib_table->ft_index);
pool_put(ip6_main.fibs, fib_table);
}
u64 count_by_prefix_length[129];
} count_routes_in_fib_at_prefix_length_arg_t;
-static void
+static int
count_routes_in_fib_at_prefix_length (clib_bihash_kv_24_8_t * kvp,
void *arg)
{
int mask_width;
if ((kvp->key[2]>>32) != ap->fib_index)
- return;
+ return (BIHASH_WALK_CONTINUE);
mask_width = kvp->key[2] & 0xFF;
ap->count_by_prefix_length[mask_width]++;
+
+ return (BIHASH_WALK_CONTINUE);
}
static clib_error_t *
fib_table->ft_epoch,
format_fib_table_flags, fib_table->ft_flags);
- FOR_EACH_FIB_SOURCE(source)
+ vec_foreach_index(source, fib_table->ft_locks)
{
if (0 != fib_table->ft_locks[source])
{