Skip to content

Commit

Permalink
Allow PORT attribute lists to be set to internal (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored and lguohan committed Jan 9, 2019
1 parent 2165dbf commit 937515a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions meta/saisanitycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,14 @@ void check_attr_default_required(
}
}

if (md->objecttype == SAI_OBJECT_TYPE_PORT)
{
/*
* Allow PORT non object list attributes to be set to internal switch values.
*/
break;
}

if (md->defaultvalue == NULL)
{
META_MD_ASSERT_FAIL(md, "default value type is provided, but default value pointer is NULL");
Expand Down Expand Up @@ -867,6 +875,14 @@ void check_attr_default_required(
case SAI_ATTR_VALUE_TYPE_IP_ADDRESS_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_EYE_VALUES_LIST:

if (md->objecttype == SAI_OBJECT_TYPE_PORT && md->defaultvaluetype == SAI_DEFAULT_VALUE_TYPE_SWITCH_INTERNAL)
{
/*
* Allow non object lists on PORT to be set to internal default value.
*/
break;
}

if (md->defaultvaluetype == SAI_DEFAULT_VALUE_TYPE_EMPTY_LIST)
{
break;
Expand Down Expand Up @@ -1074,6 +1090,14 @@ void check_attr_default_value_type(

case SAI_DEFAULT_VALUE_TYPE_SWITCH_INTERNAL:

if (md->objecttype == SAI_OBJECT_TYPE_PORT)
{
/*
* Allow PORT attribute list's to be set to internal.
*/
break;
}

if (md->flags != SAI_ATTR_FLAGS_READ_ONLY)
{
META_MD_ASSERT_FAIL(md, "default internal currently can be set only on read only objects");
Expand Down

0 comments on commit 937515a

Please sign in to comment.