]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix label allocation when room space before first chunk
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 3 Oct 2023 15:27:42 +0000 (17:27 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 18 Oct 2023 07:41:02 +0000 (09:41 +0200)
After ISIS first allocates a label chunk at [1000;2000],
the '16' label value is not used when BGP tries to
allocate a label chunk in auto mode. This does not happen
when BGP is the only one to do the label allocation.

When a label chunk has been accepted, the next label
request checks if there is room space before the existing
label chunk, and uses the lower label value to 17, and not
16.

Fix this by changing the previous range end 'prev_end' label
value to 15 which is the end of the reserved MPLS label
range.

Fixes: 3c8449794318 ("zebra: label manager should never return a reserved block")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
zebra/label_manager.c

index b2926da15ddf5c3b9b19c704f518ff496a3f249c..32dc2cd250f649dbd35650a7e2871611081009c2 100644 (file)
@@ -314,7 +314,7 @@ assign_label_chunk(uint8_t proto, unsigned short instance, uint32_t session_id,
 {
        struct label_manager_chunk *lmc;
        struct listnode *node;
-       uint32_t prev_end = MPLS_LABEL_UNRESERVED_MIN;
+       uint32_t prev_end = MPLS_LABEL_UNRESERVED_MIN - 1;
 
        /* handle chunks request with a specific base label
         * - static label requests: BGP hardset value, Pathd