Skip to content

Commit df38186

Browse files
authored
[Pfx_len] Extend prefix length for routes and advertisement (#182)
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.
1 parent c80e7a8 commit df38186

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

go-server-server/go/default.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,8 +1286,8 @@ func ConfigVrouterVrfIdRoutesPatch(w http.ResponseWriter, r *http.Request) {
12861286
continue
12871287
}
12881288
} else {
1289-
if prefix_len < 64 {
1290-
r.Error_msg = "Prefix length lesser than 64 is not supported"
1289+
if prefix_len < 48 {
1290+
r.Error_msg = "Prefix length lesser than 48 is not supported"
12911291
failed = append(failed, r)
12921292
continue
12931293
}
@@ -1483,8 +1483,8 @@ func ConfigVrouterVrfIdRoutesPatch(w http.ResponseWriter, r *http.Request) {
14831483
continue
14841484
}
14851485
} else {
1486-
if prefix_len < 60 {
1487-
r.Error_msg = "Adv Prefix length lesser than 60 is not supported"
1486+
if prefix_len < 40 {
1487+
r.Error_msg = "Adv Prefix length lesser than 40 is not supported"
14881488
failed = append(failed, r)
14891489
continue
14901490
}

test/test_restapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,7 +2486,7 @@ def test_patch_update_routes_unsupported_ipprefix(sef, setup_restapi_client):
24862486
r = restapi_client.patch_config_vrouter_vrf_id_routes("vnet-guid-1", [route])
24872487
assert r.status_code == 207
24882488
j = json.loads(r.text)
2489-
assert j['failed'][0]['error_msg'] == "Prefix length lesser than 64 is not supported"
2489+
assert j['failed'][0]['error_msg'] == "Prefix length lesser than 48 is not supported"
24902490

24912491
def test_patch_update_routes_with_optional_args(self, setup_restapi_client):
24922492
db, _, _, restapi_client = setup_restapi_client
@@ -2535,7 +2535,7 @@ def test_patch_update_routes_with_optional_args(self, setup_restapi_client):
25352535
r = restapi_client.patch_config_vrouter_vrf_id_routes("vnet-guid-1", [route])
25362536
assert r.status_code == 207
25372537
j = json.loads(r.text)
2538-
assert j['failed'][0]['error_msg'] == "Adv Prefix length lesser than 60 is not supported"
2538+
assert j['failed'][0]['error_msg'] == "Adv Prefix length lesser than 40 is not supported"
25392539

25402540
# Append and remove
25412541
route = {

0 commit comments

Comments
 (0)