Commit 8854561d33 for frr
commit 8854561d339dc387388830ed1b4fbd12e35bd674
Author: Philippe Guibert <philippe.guibert@6wind.com>
Date: Tue Nov 17 18:46:17 2026 +0100
zebra: limit the Wide LIB to the 16-bit uSID functions
A Wide LIB range is accepted up to 4294967295, while the uSID functions
of the f3216 and f4816 formats are 16-bit:
> format usid-f3216
> wide-local-id-block start 0 end 1000000000
The SID block allocates one Wide LIB entry, with two lists, per function
of the range, when a locator using the format is created. Zebra then
allocates a billion entries, and stops responding or runs out of memory.
Limit the bounds of the Wide LIB commands to 65535.
The srv6_sid_manager tests moved the Wide LIB of usid-f4816 to
100000-100010, above the default Explicit Wide LIB start of 65527,
which is now refused. Use 65530-65535 instead, which is still above it.
Fixes: 51d3cd8a00 ("zebra: CLI to override default SID format config")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
diff --git a/tests/topotests/srv6_sid_manager/test_srv6_sid_manager.py b/tests/topotests/srv6_sid_manager/test_srv6_sid_manager.py
index 782dac02c7..cbdac1765f 100644
--- a/tests/topotests/srv6_sid_manager/test_srv6_sid_manager.py
+++ b/tests/topotests/srv6_sid_manager/test_srv6_sid_manager.py
@@ -517,18 +517,18 @@ def test_usid_wide_lib_explicit_range():
# The Wide LIB can move above the Explicit Wide LIB start
output = router.vtysh_cmd(
- USID_F4816_CONTEXT + "wide-local-id-block start 100000 end 100010\n"
+ USID_F4816_CONTEXT + "wide-local-id-block start 65530 end 65535\n"
)
assert (
- "Explicit Wide LIB start (65527) is below the Wide LIB start (100000), "
- "the Explicit Wide LIB starts at 100000" in output
+ "Explicit Wide LIB start (65527) is below the Wide LIB start (65530), "
+ "the Explicit Wide LIB starts at 65530" in output
)
# Resetting the Explicit Wide LIB cannot fail because of the Wide LIB
output = router.vtysh_cmd(USID_F4816_CONTEXT + "no wide-local-id-block explicit\n")
assert (
- "Explicit Wide LIB start (65527) is below the Wide LIB start (100000), "
- "the Explicit Wide LIB starts at 100000" in output
+ "Explicit Wide LIB start (65527) is below the Wide LIB start (65530), "
+ "the Explicit Wide LIB starts at 65530" in output
)
# Nor can resetting the Wide LIB fail because of the Explicit Wide LIB
@@ -1099,15 +1099,15 @@ def test_usid_wide_lib_config_survives_zebra_restart():
# A Wide LIB above the default Explicit Wide LIB start of 65527
router.vtysh_cmd(
USID_F4816_CONTEXT
- + """wide-local-id-block explicit start 100005
-wide-local-id-block start 100000 end 100010
+ + """wide-local-id-block explicit start 65533
+wide-local-id-block start 65530 end 65535
"""
)
check_wide_lib_config_after_zebra_restart(
router,
[
- "wide-local-id-block start 100000 end 100010",
- "wide-local-id-block explicit start 100005",
+ "wide-local-id-block start 65530 end 65535",
+ "wide-local-id-block explicit start 65533",
],
)
diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c
index 33b82f61d0..d2f91c86e6 100644
--- a/zebra/zebra_srv6_vty.c
+++ b/zebra/zebra_srv6_vty.c
@@ -1509,7 +1509,7 @@ static void srv6_sid_format_usid_wlib_warn(struct vty *vty, const struct srv6_si
DEFPY(srv6_sid_format_usid_wlib,
srv6_sid_format_usid_wlib_cmd,
- "wide-local-id-block start (0-4294967295)$start end (0-4294967295)$end",
+ "wide-local-id-block start (0-65535)$start end (0-65535)$end",
"Configure Wide LIB\n"
"Configure the start value for the Wide LIB\n"
"Specify the start value for the Wide LIB\n"
@@ -1540,7 +1540,7 @@ DEFPY(srv6_sid_format_usid_wlib,
DEFPY(no_srv6_sid_format_usid_wlib,
no_srv6_sid_format_usid_wlib_cmd,
- "no wide-local-id-block [start (0-4294967295) end (0-4294967295)]",
+ "no wide-local-id-block [start (0-65535) end (0-65535)]",
NO_STR
"Configure Wide LIB\n"
"Configure the start value for the Wide LIB\n"
@@ -1575,7 +1575,7 @@ DEFPY(no_srv6_sid_format_usid_wlib,
DEFPY(srv6_sid_format_usid_wide_lib_explicit,
srv6_sid_format_usid_wide_lib_explicit_cmd,
- "wide-local-id-block explicit start (0-4294967295)$start",
+ "wide-local-id-block explicit start (0-65535)$start",
"Configure Wide LIB\n"
"Configure Explicit Wide LIB\n"
"Configure the start value for the Explicit Wide LIB\n"
@@ -1596,7 +1596,7 @@ DEFPY(srv6_sid_format_usid_wide_lib_explicit,
DEFPY(no_srv6_sid_format_usid_wide_lib_explicit,
no_srv6_sid_format_usid_wide_lib_explicit_cmd,
- "no wide-local-id-block explicit [start (0-4294967295)]",
+ "no wide-local-id-block explicit [start (0-65535)]",
NO_STR
"Configure Wide LIB\n"
"Configure Explicit Wide LIB\n"