summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Stapp <mjs.ietf@gmail.com>2025-03-27 16:22:43 -0400
committerGitHub <noreply@github.com>2025-03-27 16:22:43 -0400
commit10d922b6316034a63c820e2c0e81c96dafaebff6 (patch)
treeb4446ff541797e663d8a27da60b0d96d60ccc2f6
parent0d28f428ae252680a87e0bd659d72884b3b7a50c (diff)
parent0436ef828e3c18b01b5b2a67ed5a7cfa9f0ef7a1 (diff)
Merge pull request #18522 from opensourcerouting/fix/revert_18478
Revert backport for crash when modifying SRv6 SID for stable/10.3 branch
-rw-r--r--staticd/static_nb_config.c3
-rw-r--r--tests/topotests/static_srv6_sids/expected_srv6_sids_sid_modify.json201
-rw-r--r--tests/topotests/static_srv6_sids/r1/setup.sh3
-rwxr-xr-xtests/topotests/static_srv6_sids/test_static_srv6_sids.py38
4 files changed, 2 insertions, 243 deletions
diff --git a/staticd/static_nb_config.c b/staticd/static_nb_config.c
index 0267f7c3ae..e2ab1f2ffe 100644
--- a/staticd/static_nb_config.c
+++ b/staticd/static_nb_config.c
@@ -1112,7 +1112,6 @@ int routing_control_plane_protocols_control_plane_protocol_staticd_segment_routi
yang_dnode_get_ipv6p(&sid_value, args->dnode, "sid");
sid = static_srv6_sid_alloc(&sid_value);
nb_running_set_entry(args->dnode, sid);
- listnode_add(srv6_sids, sid);
return NB_OK;
}
@@ -1146,11 +1145,13 @@ void routing_control_plane_protocols_control_plane_protocol_staticd_segment_rout
"%s: Locator %s not found, trying to get locator information from zebra",
__func__, sid->locator_name);
static_zebra_srv6_manager_get_locator(sid->locator_name);
+ listnode_add(srv6_sids, sid);
return;
}
sid->locator = locator;
+ listnode_add(srv6_sids, sid);
static_zebra_request_srv6_sid(sid);
}
diff --git a/tests/topotests/static_srv6_sids/expected_srv6_sids_sid_modify.json b/tests/topotests/static_srv6_sids/expected_srv6_sids_sid_modify.json
deleted file mode 100644
index 070b7ade20..0000000000
--- a/tests/topotests/static_srv6_sids/expected_srv6_sids_sid_modify.json
+++ /dev/null
@@ -1,201 +0,0 @@
-{
- "fcbb:bbbb:1::/48": [
- {
- "prefix": "fcbb:bbbb:1::/48",
- "prefixLen": 48,
- "protocol": "static",
- "vrfId": 0,
- "vrfName": "default",
- "selected": true,
- "destSelected": true,
- "distance": 1,
- "metric": 0,
- "installed": true,
- "table": 254,
- "internalStatus": 16,
- "internalFlags": 9,
- "internalNextHopNum": 1,
- "internalNextHopActiveNum": 1,
- "nexthops": [
- {
- "flags": 3,
- "fib": true,
- "directlyConnected": true,
- "interfaceName": "sr0",
- "active": true,
- "weight": 1,
- "seg6local": {
- "action": "End",
- "sidStructure": {
- "blockLen": 32,
- "nodeLen": 16,
- "funcLen": 0,
- "argLen": 0
- }
- },
- "seg6localContext": {
-
- }
- }
- ]
- }
- ],
- "fcbb:bbbb:1:fe10::/64": [
- {
- "prefix": "fcbb:bbbb:1:fe10::/64",
- "prefixLen": 64,
- "protocol": "static",
- "vrfId": 0,
- "vrfName": "default",
- "selected": true,
- "destSelected": true,
- "distance": 1,
- "metric": 0,
- "installed": true,
- "table": 254,
- "internalStatus": 16,
- "internalFlags": 9,
- "internalNextHopNum": 1,
- "internalNextHopActiveNum": 1,
- "nexthops": [
- {
- "flags": 3,
- "fib": true,
- "directlyConnected": true,
- "interfaceName": "Vrf10",
- "active": true,
- "weight": 1,
- "seg6local": {
- "action": "End.DT4",
- "sidStructure": {
- "blockLen": 32,
- "nodeLen": 16,
- "funcLen": 16,
- "argLen": 0
- }
- },
- "seg6localContext": {
- "table": 10
- }
- }
- ]
- }
- ],
- "fcbb:bbbb:1:fe20::/64": [
- {
- "prefix": "fcbb:bbbb:1:fe20::/64",
- "prefixLen": 64,
- "protocol": "static",
- "vrfId": 0,
- "vrfName": "default",
- "selected": true,
- "destSelected": true,
- "distance": 1,
- "metric": 0,
- "installed": true,
- "table": 254,
- "internalStatus": 16,
- "internalFlags": 9,
- "internalNextHopNum": 1,
- "internalNextHopActiveNum": 1,
- "nexthops": [
- {
- "flags": 3,
- "fib": true,
- "directlyConnected": true,
- "interfaceName": "Vrf40",
- "active": true,
- "weight": 1,
- "seg6local": {
- "action": "End.DT46",
- "sidStructure": {
- "blockLen": 32,
- "nodeLen": 16,
- "funcLen": 16,
- "argLen": 0
- }
- },
- "seg6localContext": {
- "table": 40
- }
- }
- ]
- }
- ],
- "fcbb:bbbb:1:fe30::/64": [
- {
- "prefix": "fcbb:bbbb:1:fe30::/64",
- "prefixLen": 64,
- "protocol": "static",
- "vrfId": 0,
- "vrfName": "default",
- "selected": true,
- "destSelected": true,
- "distance": 1,
- "metric": 0,
- "installed": true,
- "table": 254,
- "internalStatus": 16,
- "internalFlags": 9,
- "internalNextHopNum": 1,
- "internalNextHopActiveNum": 1,
- "nexthops": [
- {
- "flags": 3,
- "fib": true,
- "directlyConnected": true,
- "interfaceName": "Vrf30",
- "active": true,
- "weight": 1,
- "seg6local": {
- "action": "End.DT46",
- "sidStructure": {
- "blockLen": 32,
- "nodeLen": 16,
- "funcLen": 16,
- "argLen": 0
- }
- },
- "seg6localContext": {
- "table": 30
- }
- }
- ]
- }
- ],
- "fcbb:bbbb:1:fe40::/64": [
- {
- "prefix": "fcbb:bbbb:1:fe40::/64",
- "prefixLen": 64,
- "protocol": "static",
- "vrfId": 0,
- "vrfName": "default",
- "selected": true,
- "destSelected": true,
- "distance": 1,
- "metric": 0,
- "installed": true,
- "table": 254,
- "internalStatus": 16,
- "internalFlags": 9,
- "internalNextHopNum": 1,
- "internalNextHopActiveNum": 1,
- "nexthops": [
- {
- "flags": 3,
- "fib": true,
- "directlyConnected": true,
- "interfaceName": "sr0",
- "active": true,
- "weight": 1,
- "seg6local": {
- "action": "End.X"
- },
- "seg6localContext": {
- "nh6": "2001::2"
- }
- }
- ]
- }
- ]
-} \ No newline at end of file
diff --git a/tests/topotests/static_srv6_sids/r1/setup.sh b/tests/topotests/static_srv6_sids/r1/setup.sh
index 99cbdee280..040be73914 100644
--- a/tests/topotests/static_srv6_sids/r1/setup.sh
+++ b/tests/topotests/static_srv6_sids/r1/setup.sh
@@ -10,7 +10,4 @@ ip link set Vrf20 up
ip link add Vrf30 type vrf table 30
ip link set Vrf30 up
-ip link add Vrf40 type vrf table 40
-ip link set Vrf40 up
-
sysctl -w net.vrf.strict_mode=1
diff --git a/tests/topotests/static_srv6_sids/test_static_srv6_sids.py b/tests/topotests/static_srv6_sids/test_static_srv6_sids.py
index 1ea94c8c07..565b38f625 100755
--- a/tests/topotests/static_srv6_sids/test_static_srv6_sids.py
+++ b/tests/topotests/static_srv6_sids/test_static_srv6_sids.py
@@ -172,44 +172,6 @@ def test_srv6_static_sids_sid_readd():
check_srv6_static_sids(router, "expected_srv6_sids.json")
-def test_srv6_static_sids_sid_modify():
- """
- Modify the static SIDs and verify the routing table
- """
- tgen = get_topogen()
- if tgen.routers_have_failure():
- pytest.skip(tgen.errors)
- router = tgen.gears["r1"]
-
- def _check_srv6_static_sids(router, expected_route_file):
- logger.info("checking zebra srv6 static sids")
- output = json.loads(router.vtysh_cmd("show ipv6 route static json"))
- expected = open_json_file("{}/{}".format(CWD, expected_route_file))
- return topotest.json_cmp(output, expected)
-
- def check_srv6_static_sids(router, expected_file):
- func = functools.partial(_check_srv6_static_sids, router, expected_file)
- _, result = topotest.run_and_expect(func, None, count=15, wait=1)
- assert result is None, "Failed"
-
- router.vtysh_cmd(
- """
- configure terminal
- segment-routing
- srv6
- static-sids
- sid fcbb:bbbb:1:fe20::/64 locator MAIN behavior uDT46 vrf Vrf40
- """
- )
-
- # FOR DEVELOPER:
- # If you want to stop some specific line and start interactive shell,
- # please use tgen.mininet_cli() to start it.
-
- logger.info("Test for srv6 sids configuration")
- check_srv6_static_sids(router, "expected_srv6_sids_sid_modify.json")
-
-
def test_srv6_static_sids_sid_delete_all():
"""
Remove all static SIDs and verify they get removed