From 29004b85d9e1ba665f38c4b0d33cdc3f00e4c7c6 Mon Sep 17 00:00:00 2001 From: Andriy Kokhan Date: Sun, 17 Nov 2024 20:24:36 +0200 Subject: [PATCH] Fixed gen_attr_list tool for SAI_OBJECT_TYPE_EXTENSIONS_ (#241) Signed-off-by: Andriy Kokhan --- scripts/gen_attr_list/generate_attrs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/gen_attr_list/generate_attrs.cpp b/scripts/gen_attr_list/generate_attrs.cpp index ff55d6a7..e6b1d663 100644 --- a/scripts/gen_attr_list/generate_attrs.cpp +++ b/scripts/gen_attr_list/generate_attrs.cpp @@ -123,7 +123,9 @@ nlohmann::json attribute_properties(const sai_attr_metadata_t *meta) nlohmann::json j; for (size_t i = 0; i < meta->allowedobjecttypeslength; i++) { - j.push_back(sai_metadata_all_object_type_infos[obj_list[i]]->objecttypename); + int type_idx = (obj_list[i] > SAI_OBJECT_TYPE_EXTENSIONS_RANGE_START) ? + obj_list[i] - SAI_OBJECT_TYPE_EXTENSIONS_RANGE_START : obj_list[i]; + j.push_back(sai_metadata_all_object_type_infos[type_idx]->objecttypename); } json["objects"] = j; }