summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-11-09 10:13:24 +0000
committerMatthew Smith <mgsmith@netgate.com>2020-11-19 21:56:49 +0000
commit8b276df32f0c833b31f8a5c8408855afbbde1307 (patch)
tree4690d6bdd25372205436e7e04369a7e630ac5408 /src/vnet/ipip
parent4a98cf9648bc6852be9ba6622dc633f2168a7f66 (diff)
ipip: Don't crash when showing non-existant tunnel index
Type: fix Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I9717d420e42098e291c5b6c7d18e935ad78fdc3d
Diffstat (limited to 'src/vnet/ipip')
-rw-r--r--src/vnet/ipip/ipip_cli.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/ipip/ipip_cli.c b/src/vnet/ipip/ipip_cli.c
index 510806b0c11..231c7e3108f 100644
--- a/src/vnet/ipip/ipip_cli.c
+++ b/src/vnet/ipip/ipip_cli.c
@@ -232,6 +232,8 @@ static clib_error_t *show_ipip_tunnel_command_fn(vlib_main_t *vm,
({vlib_cli_output(vm, "%U", format_ipip_tunnel, t); }));
/* *INDENT-ON* */
} else {
+ if (pool_is_free_index (gm->tunnels, ti))
+ return clib_error_return(0, "unknown index:%d", ti);
t = pool_elt_at_index(gm->tunnels, ti);
if (t)
vlib_cli_output(vm, "%U", format_ipip_tunnel, t);