summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Ruddy <pat@voltanet.io>2020-12-09 10:25:38 +0000
committerPat Ruddy <pat@voltanet.io>2021-01-04 14:29:44 +0000
commit189982283ad88132fbdb1342895c7404fa5fc34a (patch)
tree96ab93bccdacb8764a00c57c766b792bd15d7812
parent3c844979431822386bcc2c8728a83513528675b2 (diff)
zebra: labelmanager could return reserved labels
when checking if there is a "hole" behind the current reservation marker the calculation of whether the hole is big enough to satisfy the requested chunk is out by 1. This could result in returning a label which has already been allocated. Signed-off-by: Pat Ruddy <pat@voltanet.io>
-rw-r--r--zebra/label_manager.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/zebra/label_manager.c b/zebra/label_manager.c
index b393e656d4..e642e22c95 100644
--- a/zebra/label_manager.c
+++ b/zebra/label_manager.c
@@ -335,8 +335,7 @@ static struct label_manager_chunk *assign_label_chunk(uint8_t proto,
}
/* check if we hadve a "hole" behind us that we can squeeze into
*/
- if ((lmc->start > prev_end)
- && (lmc->start - prev_end >= size)) {
+ if ((lmc->start > prev_end) && (lmc->start - prev_end > size)) {
lmc = create_label_chunk(proto, instance, session_id,
keep, prev_end + 1,
prev_end + size);