summaryrefslogtreecommitdiffstats
path: root/zebra/label_manager.c
diff options
context:
space:
mode:
authorGalaxyGorilla <sascha@netdef.org>2020-02-27 13:57:13 +0100
committerSebastien Merle <sebastien@netdef.org>2020-08-07 11:08:49 +0200
commit7658c2e56053e99cce68d63e754f89c071ac3d37 (patch)
tree3e07ba00b1e9538cb43bab4fadd564292c05e4f6 /zebra/label_manager.c
parentlib: add generic struct ipaddr comparison function (diff)
downloadfrr-7658c2e56053e99cce68d63e754f89c071ac3d37.tar.xz
frr-7658c2e56053e99cce68d63e754f89c071ac3d37.zip
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 <sascha@netdef.org>
Diffstat (limited to 'zebra/label_manager.c')
-rw-r--r--zebra/label_manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/label_manager.c b/zebra/label_manager.c
index 93736e672..d312a661f 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;
}