Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staticd: Fix wrong xpath in no sid X:X::X:X/M #17989

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

cscarpitta
Copy link
Contributor

When a user wants to delete a specific SRv6 SID, he executes the no sid X:X::X:X/M command.
However, by mistake, in addition to deleting the SID requested by the user, this command also removes all other SIDs.

This happens because no sid X:X::X:X/M triggers a destroy operation on the wrong xpath frr-staticd:staticd/segment-routing/srv6.

This commit fixes the issue by replacing the wrong xpath frr-staticd:staticd/segment-routing/srv6 with the correct xpath frr-staticd:staticd/segment-routing/srv6/static-sids/sid[sid='%s'].

This ensures that the no sid X:X::X:X/M command only deletes the SID that was requested by the user.

When a user wants to delete a specific SRv6 SID, he executes the
`no sid X:X::X:X/M` command.
However, by mistake, in addition to deleting the SID requested by the
user, this command also removes all other SIDs.

This happens because `no sid X:X::X:X/M` triggers a destroy operation
on the wrong xpath `frr-staticd:staticd/segment-routing/srv6`.

This commit fixes the issue by replacing the wrong xpath
`frr-staticd:staticd/segment-routing/srv6` with the correct xpath
`frr-staticd:staticd/segment-routing/srv6/static-sids/sid[sid='%s']`.

This ensures that the `no sid X:X::X:X/M` command only deletes the SID
that was requested by the user.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add a new test case that deletes a SID and verifies that only this
SID has been removed from the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add a new test case that re-add the deleted SIDs and verifies that all
SIDs are added back to the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
@frrbot frrbot bot added staticd tests Topotests, make check, etc labels Feb 3, 2025
@ton31337 ton31337 merged commit cb7d1cb into FRRouting:master Feb 4, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants