diff options
author | Eyal Bari <ebari@cisco.com> | 2017-06-12 17:07:22 +0300 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-06-12 22:52:35 +0000 |
commit | b823df5a7db8208f0162a50ba034a2037f7e7c67 (patch) | |
tree | e7ccba5ff72902f16d0e76b1cf8f18b3d993bf3a /src | |
parent | 4af9ba1dabe3dbd4a2dd3d8c71434477c5ea81b9 (diff) |
L2FIB:fix crash in show with deleted subif entries
after deleting a sub interface it's l2fib entries are left with a dangling
sw_if_index (while waiting for the ager to delete them).
changed "show l2fib" to reflect that state with "Deleted" as the interface name.
added sleep in test_l2_fib as a workaround for packets still passing after flush
will investigate...
Change-Id: Id998d7d3c6a073ef5005c5f3009e1cfb7febf7db
Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/l2/l2_fib.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c index d4207e35..f17eee2a 100644 --- a/src/vnet/l2/l2_fib.c +++ b/src/vnet/l2/l2_fib.c @@ -62,10 +62,13 @@ format_vnet_sw_if_index_name_with_NA (u8 * s, va_list * args) u32 sw_if_index = va_arg (*args, u32); if (sw_if_index == ~0) return format (s, "N/A"); - else - return format (s, "%U", - format_vnet_sw_interface_name, vnm, - vnet_get_sw_interface (vnm, sw_if_index)); + + vnet_sw_interface_t *swif = vnet_get_sw_interface_safe (vnm, sw_if_index); + if (!swif) + return format (s, "Deleted"); + + return format (s, "%U", format_vnet_sw_interface_name, vnm, + vnet_get_sw_interface_safe (vnm, sw_if_index)); } void |