summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat64_cli.c
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2018-01-26 05:07:23 -0800
committerOle Trøan <otroan@employees.org>2018-01-30 09:22:24 +0000
commit6898507b421667a883d87cc879e800fa40b83929 (patch)
tree82d5396d1ac63cae3abeafabbbd68638c74c59ce /src/plugins/nat/nat64_cli.c
parentdb14f5aff69311d13a0a90baa3567e92f3faa783 (diff)
NAT: replace format_vnet_sw_interface_name with format_vnet_sw_if_index_name (VPP-1149)
Avoid crash when interface was deleted. Change-Id: I2ac3031c13ca5ad3360495e1c4cb90b0002be5ff Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat64_cli.c')
-rw-r--r--src/plugins/nat/nat64_cli.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/nat/nat64_cli.c b/src/plugins/nat/nat64_cli.c
index d1acca963a1..5b46feddb49 100644
--- a/src/plugins/nat/nat64_cli.c
+++ b/src/plugins/nat/nat64_cli.c
@@ -181,22 +181,22 @@ nat64_interface_feature_command_fn (vlib_main_t * vm,
case VNET_API_ERROR_NO_SUCH_ENTRY:
error =
clib_error_return (0, "%U NAT64 feature not enabled.",
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, sw_if_index));
+ format_vnet_sw_if_index_name, vnm,
+ sw_if_index);
goto done;
case VNET_API_ERROR_VALUE_EXIST:
error =
clib_error_return (0, "%U NAT64 feature already enabled.",
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, sw_if_index));
+ format_vnet_sw_if_index_name, vnm,
+ vnm, sw_if_index);
goto done;
case VNET_API_ERROR_INVALID_VALUE:
case VNET_API_ERROR_INVALID_VALUE_2:
error =
clib_error_return (0,
"%U NAT64 feature enable/disable failed.",
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, sw_if_index));
+ format_vnet_sw_if_index_name, vnm,
+ sw_if_index);
goto done;
default:
break;
@@ -216,22 +216,22 @@ nat64_interface_feature_command_fn (vlib_main_t * vm,
case VNET_API_ERROR_NO_SUCH_ENTRY:
error =
clib_error_return (0, "%U NAT64 feature not enabled.",
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, sw_if_index));
+ format_vnet_sw_if_index_name, vnm,
+ sw_if_index);
goto done;
case VNET_API_ERROR_VALUE_EXIST:
error =
clib_error_return (0, "%U NAT64 feature already enabled.",
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, sw_if_index));
+ format_vnet_sw_if_index_name, vnm,
+ sw_if_index);
goto done;
case VNET_API_ERROR_INVALID_VALUE:
case VNET_API_ERROR_INVALID_VALUE_2:
error =
clib_error_return (0,
"%U NAT64 feature enable/disable failed.",
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, sw_if_index));
+ format_vnet_sw_if_index_name, vnm,
+ sw_if_index);
goto done;
default:
break;
@@ -254,8 +254,8 @@ nat64_cli_interface_walk (snat_interface_t * i, void *ctx)
vlib_main_t *vm = ctx;
vnet_main_t *vnm = vnet_get_main ();
- vlib_cli_output (vm, " %U %s", format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, i->sw_if_index),
+ vlib_cli_output (vm, " %U %s", format_vnet_sw_if_index_name, vnm,
+ i->sw_if_index,
(nat_interface_is_inside (i)
&& nat_interface_is_outside (i)) ? "in out" :
nat_interface_is_inside (i) ? "in" : "out");