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>
This commit is contained in:
GalaxyGorilla 2020-02-27 12:57:13 +00:00 committed by Sebastien Merle
parent 598b0dfcc9
commit 7658c2e560

View File

@ -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;
}