summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_format.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface_format.c')
-rw-r--r--src/vnet/interface_format.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c
index df7e938894a..5694bb2f7b4 100644
--- a/src/vnet/interface_format.c
+++ b/src/vnet/interface_format.c
@@ -165,9 +165,15 @@ format_vnet_sw_if_index_name (u8 * s, va_list * args)
{
vnet_main_t *vnm = va_arg (*args, vnet_main_t *);
u32 sw_if_index = va_arg (*args, u32);
- return format (s, "%U",
- format_vnet_sw_interface_name, vnm,
- vnet_get_sw_interface (vnm, sw_if_index));
+ vnet_sw_interface_t *si;
+
+ si = vnet_get_sw_interface_safe (vnm, sw_if_index);
+
+ if (NULL == si)
+ {
+ return format (s, "DELETED");
+ }
+ return format (s, "%U", format_vnet_sw_interface_name, vnm, si);
}
u8 *