Skip to content

Commit

Permalink
Fixed gen_attr_list tool for SAI_OBJECT_TYPE_EXTENSIONS_ (#241)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Kokhan <[email protected]>
  • Loading branch information
andriy-kokhan authored Nov 17, 2024
1 parent 2c165e5 commit 29004b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/gen_attr_list/generate_attrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 29004b8

Please sign in to comment.