summaryrefslogtreecommitdiffstats
path: root/vnet/vnet/ip/ip4_forward.c
diff options
context:
space:
mode:
Diffstat (limited to 'vnet/vnet/ip/ip4_forward.c')
-rw-r--r--vnet/vnet/ip/ip4_forward.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index a50664cc662..a84b83bc225 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -103,6 +103,14 @@ find_ip4_fib_by_table_index_or_id (ip4_main_t * im,
fib_index = table_index_or_id;
if (! (flags & IP4_ROUTE_FLAG_FIB_INDEX))
{
+ if (table_index_or_id == ~0) {
+ table_index_or_id = 0;
+ while ((p = hash_get (im->fib_index_by_table_id, table_index_or_id))) {
+ table_index_or_id++;
+ }
+ return create_fib_with_table_id (im, table_index_or_id);
+ }
+
p = hash_get (im->fib_index_by_table_id, table_index_or_id);
if (! p)
return create_fib_with_table_id (im, table_index_or_id);