diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2023-12-06 17:34:57 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2023-12-07 10:14:49 +0000 |
commit | 535364e90459566b603661c3dbe360c72f59ad71 (patch) | |
tree | 574bb762d345c7871081233823f00cbb968a35cb /src/vnet/interface_format.c | |
parent | 327c3230652240c91be2342639c53ee56f868d4d (diff) |
vnet: allow format deleted swifidx
This patch prevents the sw interfaces format
function to fail when the interface was deleted.
It also prints the swifindex alongside the 'DELETED'
keyword.
Printing deleted swifindex should not happen, but it is still
helpful to have these safeguards for troubleshooting in the case
invariants get corrupted (e.g. fib entry refcounts, ...)
Type: improvement
Change-Id: I66711049db2eebe0ad17e37c3a260ac81d1e5134
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet/interface_format.c')
-rw-r--r-- | src/vnet/interface_format.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/interface_format.c b/src/vnet/interface_format.c index 0c051dd4757..f74a4ea7c20 100644 --- a/src/vnet/interface_format.c +++ b/src/vnet/interface_format.c @@ -290,7 +290,7 @@ format_vnet_sw_if_index_name (u8 * s, va_list * args) if (NULL == si) { - return format (s, "DELETED"); + return format (s, "DELETED (%u)", sw_if_index); } return format (s, "%U", format_vnet_sw_interface_name, vnm, si); } @@ -305,7 +305,7 @@ format_vnet_hw_if_index_name (u8 * s, va_list * args) hi = vnet_get_hw_interface (vnm, hw_if_index); if (hi == 0) - return format (s, "DELETED"); + return format (s, "DELETED (%u)", hw_if_index); return format (s, "%v", hi->name); } |