diff options
author | 2023-12-21 11:35:30 +0100 | |
---|---|---|
committer | 2023-12-21 11:39:08 +0100 | |
commit | f3b0004f8a5de433bf8a601a7e21c7f73b321cee (patch) | |
tree | 3df5e8100065c14ebccb4767c78a23ee75675825 /src/vnet/dpo/load_balance.c | |
parent | 70335e8e50e004f0ab111a5607becf0438d806bc (diff) |
fib: format deleted LB
This patch allows the formatting of deleted Load-balancer
objects. This is needed in the case a trace references a DPO
that went away in the interim.
Type: improvement
Change-Id: I6d67519b8d62f69aafde3c8fe3065bc85a7adbde
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet/dpo/load_balance.c')
-rw-r--r-- | src/vnet/dpo/load_balance.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vnet/dpo/load_balance.c b/src/vnet/dpo/load_balance.c index fae7c1db94a..8f2a0de6ea8 100644 --- a/src/vnet/dpo/load_balance.c +++ b/src/vnet/dpo/load_balance.c @@ -149,7 +149,13 @@ load_balance_format (index_t lbi, dpo_id_t *buckets; u32 i; - lb = load_balance_get(lbi); + lb = load_balance_get_or_null(lbi); + if (lb == NULL) + { + s = format(s, "DELETED lb:%u", lbi); + return (s); + } + vlib_get_combined_counter(&(load_balance_main.lbm_to_counters), lbi, &to); vlib_get_combined_counter(&(load_balance_main.lbm_via_counters), lbi, &via); buckets = load_balance_get_buckets(lb); |