aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nat/nat.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/nat.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/nat.c')
-rw-r--r--src/plugins/nat/nat.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/nat/nat.c b/src/plugins/nat/nat.c
index 95004da26d8..0520ded0f29 100644
--- a/src/plugins/nat/nat.c
+++ b/src/plugins/nat/nat.c
@@ -2560,16 +2560,14 @@ u8 * format_snat_static_map_to_resolve (u8 * s, va_list * args)
if (m->addr_only)
s = format (s, "local %U external %U vrf %d",
format_ip4_address, &m->l_addr,
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, m->sw_if_index),
+ format_vnet_sw_if_index_name, vnm, m->sw_if_index,
m->vrf_id);
else
s = format (s, "%U local %U:%d external %U:%d vrf %d",
format_snat_protocol, m->proto,
format_ip4_address, &m->l_addr, m->l_port,
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, m->sw_if_index), m->e_port,
- m->vrf_id);
+ format_vnet_sw_if_index_name, vnm, m->sw_if_index,
+ m->e_port, m->vrf_id);
return s;
}