bond: show trace causes a crash if the interface is deleted 50/11450/3
authorSteven <sluong@cisco.com>
Thu, 29 Mar 2018 00:59:00 +0000 (17:59 -0700)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 30 Mar 2018 20:43:49 +0000 (20:43 +0000)
commit70488ab7f87096534aaadd7eab30e8515ac3d60d
treea6aa6bfeb5d3b078f934273101e69ff36955daab
parentc1613a72a7ef5443319a868879804bb53714068d
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>
src/vnet/adj/adj_nbr.c
src/vnet/bonding/cli.c
src/vnet/bonding/node.c