summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/ip/ip4_forward.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index b0390b8a44a..6a2b58c0d09 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -2989,6 +2989,7 @@ test_lookup_command_fn (vlib_main_t * vm,
unformat_input_t * input,
vlib_cli_command_t * cmd)
{
+ ip4_fib_t *fib;
u32 table_id = 0;
f64 count = 1;
u32 n;
@@ -2998,7 +2999,13 @@ test_lookup_command_fn (vlib_main_t * vm,
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
if (unformat (input, "table %d", &table_id))
- ;
+ {
+ /* Make sure the entry exists. */
+ fib = ip4_fib_get(table_id);
+ if ((fib) && (fib->index != table_id))
+ return clib_error_return (0, "<fib-index> %d does not exist",
+ table_id);
+ }
else if (unformat (input, "count %f", &count))
;