From 7658c2e56053e99cce68d63e754f89c071ac3d37 Mon Sep 17 00:00:00 2001 From: GalaxyGorilla Date: Thu, 27 Feb 2020 12:57:13 +0000 Subject: [PATCH] zebra: Fix selection of label chunks in label manager For allocating a new label range the label manager will loop the existing label chunks and compare the start and end labels with the label range in question. In case a label range should be re-allocated to the existing label chunk, the end label of the chunk is not honored correctly, e.g. the new label range has to be a true subset of the existing label chunk. This is very easy reproducable by re-allocating a single label. e.g. a label range of size 1. This problem is fixed by allowing the mentioned 'end' labels to be equal. Signed-off-by: GalaxyGorilla --- zebra/label_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/label_manager.c b/zebra/label_manager.c index 93736e672a..d312a661f3 100644 --- a/zebra/label_manager.c +++ b/zebra/label_manager.c @@ -240,7 +240,7 @@ assign_specific_label_chunk(uint8_t proto, unsigned short instance, if (lmc->proto != NO_PROTO) return NULL; - if (end < lmc->end) { + if (end <= lmc->end) { last_node = node; break; }