Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zebra: fix sid allocation should be different with 2 isis instances
With 2 ISIS SRv6 instances, the second ISIS instance always gets the same End SID as the first one. > router isis 1 > segment-routing srv6 > locator loc1 > exit > exit > router isis 2 > segment-routing srv6 > locator loc2 > end > segment-routing > srv6 > locators > locator loc1 > prefix 2001::1/64 > exit > locator loc2 > prefix 3001::1/64 > output: > 2024/06/11 17:30:15 ISIS: [N6PCR-FQ5ZA] SRv6 locator (locator loc1, prefix 2001::1/64) set for IS-IS area 1 > 2024/06/11 17:30:15 ISIS: [V4RBG-TYW5S] Requesting SRv6 SIDs for IS-IS area 1 > 2024/06/11 17:30:15 ISIS: [ZRHYM-6RMYK] isis_zebra_srv6_sid_notify: received SRv6 SID notify: ctx End USP sid_value 2001::1 sid_func 0 note ZAPI_SRV6_SID_ALLOCATED > [..] > 2024/06/11 17:36:49 ISIS: [N6PCR-FQ5ZA] SRv6 locator (locator loc2, prefix 3001::1/64) set for IS-IS area 2 > 2024/06/11 17:36:49 ISIS: [V4RBG-TYW5S] Requesting SRv6 SIDs for IS-IS area 2 > 2024/06/11 17:36:49 ISIS: [ZRHYM-6RMYK] isis_zebra_srv6_sid_notify: received SRv6 SID notify: ctx End USP sid_value 2001::1 sid_func 0 note ZAPI_SRV6_SID_ALLOCATED Actually, at the second request, ZEBRA always gives an existing dynamic SID of the first available locator, because the locator name is never checked. > 2024/06/11 17:36:49 ZEBRA: [XMBTQ-GE6EY] get_srv6_sid: received SRv6 SID alloc request: SID ctx End USP ((null)), mode=dynamic > 2024/06/11 17:36:49 ZEBRA: [R61Q3-QWR23] get_srv6_sid_dynamic: returning existing SID End USP 2001::1 > 2024/06/11 17:36:49 ZEBRA: [J1GMY-B6CAK] srv6_manager_get_sid_internal: got existing SRv6 SID for ctx End USP: sid_value=2001::1 (func=0) (proto=9, instance=0, sessionId=0), notify client Fix this by checking the locator of the existing SID. Fixes: b771bf8 ("zebra: Add functions to alloc/release SRv6 SIDs") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
- Loading branch information