From 2ad4dd3be81354602a237b3eacb2ea962dadf420 Mon Sep 17 00:00:00 2001 From: fmihoub6WIND Date: Fri, 25 Nov 2022 11:17:07 +0100 Subject: [PATCH] zebra/label_manager.c: delete label chunk upon release In zebra/label_manager.c the releasing of the label chunk is done by disowning the chunk to the system. The presence of this system label chunk will cause label assignment to fail for this use case example: label chunk ospf: 300-320 label chunk system: 510-520 label chunk isis: 1200-1300 Then we try to allocate the chunk 500-530, we get this error: "Allocation of mpls label chunk [500/530] failed" The error is raised when the below condition is true: /* if chunk is used, cannot honor request */ if (lmc->proto != NO_PROTO) return NULL; Delete the label chunk instead of disowning it when the label releasing is done. Signed-off-by: fmihoub6WIND --- zebra/label_manager.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zebra/label_manager.c b/zebra/label_manager.c index 2634a333eec2..c29dbaed2eed 100644 --- a/zebra/label_manager.c +++ b/zebra/label_manager.c @@ -412,13 +412,14 @@ int release_label_chunk(uint8_t proto, unsigned short instance, "%s: Daemon mismatch!!", __func__); continue; } - lmc->proto = NO_PROTO; - lmc->instance = 0; - lmc->session_id = 0; - lmc->keep = 0; ret = 0; break; } + if(lmc) { + list_delete_node(lbl_mgr.lc_list, node); + delete_label_chunk(lmc); + } + if (ret != 0) flog_err(EC_ZEBRA_LM_UNRELEASED_CHUNK, "%s: Label chunk not released!!", __func__);