From 2e4c644fc5397fbd2e19fecb4db74c7d0bf8dbc2 Mon Sep 17 00:00:00 2001 From: Sonic Build Admin Date: Tue, 20 Jan 2026 19:28:27 +0000 Subject: [PATCH] [Pfx_len] Extend prefix length for routes and advertisement IPv6 Prefix length to /48 (route) and /40 (advertised network) IPv4 Prefix length fixed to /18 and above for both route prefixes and advertised prefixes. However, for IPv6, its currently advertised prefix minimum length is /60. This has some limitations and extending it to accept /40 as the minimum for adv prefix and /48 as minimum for route prefixes. --- go-server-server/go/default.go | 8 ++++---- test/test_restapi.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go-server-server/go/default.go b/go-server-server/go/default.go index 3018398..069ddd0 100644 --- a/go-server-server/go/default.go +++ b/go-server-server/go/default.go @@ -1286,8 +1286,8 @@ func ConfigVrouterVrfIdRoutesPatch(w http.ResponseWriter, r *http.Request) { continue } } else { - if prefix_len < 64 { - r.Error_msg = "Prefix length lesser than 64 is not supported" + if prefix_len < 48 { + r.Error_msg = "Prefix length lesser than 48 is not supported" failed = append(failed, r) continue } @@ -1483,8 +1483,8 @@ func ConfigVrouterVrfIdRoutesPatch(w http.ResponseWriter, r *http.Request) { continue } } else { - if prefix_len < 60 { - r.Error_msg = "Adv Prefix length lesser than 60 is not supported" + if prefix_len < 40 { + r.Error_msg = "Adv Prefix length lesser than 40 is not supported" failed = append(failed, r) continue } diff --git a/test/test_restapi.py b/test/test_restapi.py index a23597d..be2b69b 100644 --- a/test/test_restapi.py +++ b/test/test_restapi.py @@ -2486,7 +2486,7 @@ def test_patch_update_routes_unsupported_ipprefix(sef, setup_restapi_client): r = restapi_client.patch_config_vrouter_vrf_id_routes("vnet-guid-1", [route]) assert r.status_code == 207 j = json.loads(r.text) - assert j['failed'][0]['error_msg'] == "Prefix length lesser than 64 is not supported" + assert j['failed'][0]['error_msg'] == "Prefix length lesser than 48 is not supported" def test_patch_update_routes_with_optional_args(self, setup_restapi_client): db, _, _, restapi_client = setup_restapi_client @@ -2535,7 +2535,7 @@ def test_patch_update_routes_with_optional_args(self, setup_restapi_client): r = restapi_client.patch_config_vrouter_vrf_id_routes("vnet-guid-1", [route]) assert r.status_code == 207 j = json.loads(r.text) - assert j['failed'][0]['error_msg'] == "Adv Prefix length lesser than 60 is not supported" + assert j['failed'][0]['error_msg'] == "Adv Prefix length lesser than 40 is not supported" # Append and remove route = {