diff --git a/meta/parse.pl b/meta/parse.pl index 127b97ecf..8298c7a23 100755 --- a/meta/parse.pl +++ b/meta/parse.pl @@ -5188,7 +5188,7 @@ sub CreateSwitchPointersAttributesList my @pointers = keys %NOTIFICATIONS; push @pointers, values %ATTR_TO_CALLBACK; - for my $name (sort @pointers) + for my $name (GetSwitchPointersInOrder(@pointers)) { next if not $name =~ /^sai_(\w+)_fn/; diff --git a/meta/saisanitycheck.c b/meta/saisanitycheck.c index 7b8fb880e..9f1666f21 100644 --- a/meta/saisanitycheck.c +++ b/meta/saisanitycheck.c @@ -5499,9 +5499,15 @@ void check_switch_pointers_list() size_t i; + sai_attr_id_t id = 0; + for (i = 0; i < sai_metadata_switch_pointers_attr_count; ++i) { META_ASSERT_NOT_NULL(sai_metadata_switch_pointers_attr[i]); + + META_ASSERT_TRUE(id <= sai_metadata_switch_pointers_attr[i]->attrid, "sai_metadata_switch_pointers_attr attr pointers expected to increase") + + id = sai_metadata_switch_pointers_attr[i]->attrid; } /* check for NULL guard */