Commit a9044d2
committed
zebra: Fix SRv6 explicit SID allocation to use the provided locator
Currently, when staticd allocates an explicit SID using the CLI:
segment-routing
srv6
static-sids
sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uDT46 vrf Vrf10
staticd requests the SRv6 SID Manager to allocate SID fcbb:bbbb:1:fe00::
from locator MAIN. However, the SID Manager incorrectly ignores the
provided locator MAIN and instead performs a lookup to find the first
locator that matches the SID prefix, then allocates the SID from that
locator regardless of which locator was requested.
This behavior can lead to SIDs being allocated from unintended locators
when multiple locators have overlapping prefixes, violating the user's
explicit locator specification.
This commit fixes the issue by adding a constraint in zebra_srv6_sid_decompose()
that enforces the SID Manager to allocate the SID only from the provided
locator when one is specified. The fix adds an early check in the locator
lookup loop to skip locators that don't match the caller-provided locator,
ensuring explicit SID allocation respects the user's locator choice.
Signed-off-by: Carmine Scarpitta <[email protected]>1 parent a12bfc5 commit a9044d2
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1322 | 1322 | | |
1323 | 1323 | | |
1324 | 1324 | | |
1325 | | - | |
1326 | | - | |
| 1325 | + | |
| 1326 | + | |
1327 | 1327 | | |
1328 | 1328 | | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1329 | 1333 | | |
1330 | 1334 | | |
1331 | 1335 | | |
| |||
1801 | 1805 | | |
1802 | 1806 | | |
1803 | 1807 | | |
1804 | | - | |
| 1808 | + | |
1805 | 1809 | | |
1806 | 1810 | | |
1807 | 1811 | | |
| |||
0 commit comments