diff options
author | Steven <sluong@cisco.com> | 2018-03-28 17:59:00 -0700 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-03-30 20:43:49 +0000 |
commit | 70488ab7f87096534aaadd7eab30e8515ac3d60d (patch) | |
tree | a6aa6bfeb5d3b078f934273101e69ff36955daab /src/vnet/adj/adj_nbr.c | |
parent | c1613a72a7ef5443319a868879804bb53714068d (diff) |
bond: show trace causes a crash if the interface is deleted
For the debug image, if the interface is removed and the trace was
collected prior to the interface delete, show trace may cause a crash.
This is because vnet_get_sw_interface_name and vnet_get_sup_hw_interface
are not safe if the interface is deleted.
The fix is to use format_vnet_sw_if_index_name if all we need is to
get the interface name in the trace to display. It would show "DELETED"
which is better than a crash.
Change-Id: I912402d3e71592ece9f49d36c8a6b7af97f3b69e
Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/vnet/adj/adj_nbr.c')
-rw-r--r-- | src/vnet/adj/adj_nbr.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vnet/adj/adj_nbr.c b/src/vnet/adj/adj_nbr.c index 97940da0271..dcf3cb149a6 100644 --- a/src/vnet/adj/adj_nbr.c +++ b/src/vnet/adj/adj_nbr.c @@ -981,10 +981,8 @@ format_adj_nbr_incomplete (u8* s, va_list *ap) format_ip46_address, &adj->sub_type.nbr.next_hop, adj_proto_to_46(adj->ia_nh_proto)); s = format (s, " %U", - format_vnet_sw_interface_name, - vnm, - vnet_get_sw_interface(vnm, - adj->rewrite_header.sw_if_index)); + format_vnet_sw_if_index_name, + vnm, adj->rewrite_header.sw_if_index); return (s); } |