summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/fib/fib_entry.c12
-rw-r--r--src/vnet/fib/fib_table.h2
-rw-r--r--src/vnet/fib/ip4_fib.c5
-rw-r--r--src/vnet/fib/ip6_fib.c5
4 files changed, 12 insertions, 12 deletions
diff --git a/src/vnet/fib/fib_entry.c b/src/vnet/fib/fib_entry.c
index b78346ce45a..adf880b8bbb 100644
--- a/src/vnet/fib/fib_entry.c
+++ b/src/vnet/fib/fib_entry.c
@@ -1828,10 +1828,18 @@ fib_entry_pool_size (void)
return (pool_elts(fib_entry_pool));
}
-#if CLIB_DEBUG > 0
void
fib_table_assert_empty (const fib_table_t *fib_table)
{
+ if (0 == fib_table->ft_total_route_counts)
+ return;
+
+ vlib_log_err (fib_entry_logger,
+ "BUG: %U table %d (index %d) is not empty",
+ format_fib_protocol, fib_table->ft_proto,
+ fib_table->ft_table_id, fib_table->ft_index);
+
+#if CLIB_DEBUG > 0
fib_node_index_t *fei, *feis = NULL;
fib_entry_t *fib_entry;
@@ -1848,8 +1856,8 @@ fib_table_assert_empty (const fib_table_t *fib_table)
}
ASSERT(0);
-}
#endif
+}
static clib_error_t *
show_fib_entry_command (vlib_main_t * vm,
diff --git a/src/vnet/fib/fib_table.h b/src/vnet/fib/fib_table.h
index 0eaaa67eea2..d78c9e619b8 100644
--- a/src/vnet/fib/fib_table.h
+++ b/src/vnet/fib/fib_table.h
@@ -980,9 +980,7 @@ extern u8 *format_fib_table_memory(u8 *s, va_list *args);
/**
* Debug function
*/
-#if CLIB_DEBUG > 0
extern void fib_table_assert_empty(const fib_table_t *fib_table);
-#endif
#endif
diff --git a/src/vnet/fib/ip4_fib.c b/src/vnet/fib/ip4_fib.c
index 0eff8d0d485..23f70a770bf 100644
--- a/src/vnet/fib/ip4_fib.c
+++ b/src/vnet/fib/ip4_fib.c
@@ -201,10 +201,7 @@ ip4_fib_table_destroy (u32 fib_index)
/*
* validate no more routes.
*/
-#if CLIB_DEBUG > 0
- if (0 != fib_table->ft_total_route_counts)
- fib_table_assert_empty(fib_table);
-#endif
+ fib_table_assert_empty(fib_table);
vec_foreach(n_locks, fib_table->ft_src_route_counts)
{
diff --git a/src/vnet/fib/ip6_fib.c b/src/vnet/fib/ip6_fib.c
index d37b77e08a4..ccf8e22f5a7 100644
--- a/src/vnet/fib/ip6_fib.c
+++ b/src/vnet/fib/ip6_fib.c
@@ -160,10 +160,7 @@ ip6_fib_table_destroy (u32 fib_index)
/*
* validate no more routes.
*/
-#if CLIB_DEBUG > 0
- if (0 != fib_table->ft_total_route_counts)
- fib_table_assert_empty(fib_table);
-#endif
+ fib_table_assert_empty(fib_table);
vec_foreach_index(source, fib_table->ft_src_route_counts)
{