]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Do not allow SRv6 func_bit_len > 20
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Thu, 6 Oct 2022 15:26:57 +0000 (17:26 +0200)
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Tue, 18 Oct 2022 14:08:24 +0000 (16:08 +0200)
Currently, the SID transposition algorithm implemented in bgpd handles
incorrectly the SRv6 locators with function length greater than 20 bits.
To prevent issues, we currently limit the function length to 20 bits.

This limit will be removed when the bgpd SID transposition is fixed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
zebra/zebra_srv6_vty.c

index e00f974e778f1425a9028ee3fb8fcf2c9d81295b..9adfc6550a586937b80992f0d1405fba428f5c50 100644 (file)
@@ -318,6 +318,19 @@ DEFPY (locator_prefix,
                return CMD_WARNING_CONFIG_FAILED;
        }
 
+       /*
+        * Currently, the SID transposition algorithm implemented in bgpd
+        * handles incorrectly the SRv6 locators with function length greater
+        * than 20 bits. To prevent issues, we currently limit the function
+        * length to 20 bits.
+        * This limit will be removed when the bgpd SID transposition is fixed.
+        */
+       if (func_bit_len > 20) {
+               vty_out(vty,
+                       "%% currently func_bit_len > 20 is not supported\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
        locator->block_bits_length = block_bit_len;
        locator->node_bits_length = node_bit_len;
        locator->function_bits_length = func_bit_len;