Skip to content

Commit

Permalink
[aclorch]: Move ACL stage check to validate() function (sonic-net#542)
Browse files Browse the repository at this point in the history
if (stage == ACL_STAGE_UNKNOWN) return false;

This logic should be part of the AclTable validate() function
instead of in the create() function.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
  • Loading branch information
Shuotian Cheng authored Jul 20, 2018
1 parent 6030177 commit 0faf02b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ bool AclTable::validate()
{
// Control plane ACLs are handled by a separate process
if (type == ACL_TABLE_UNKNOWN || type == ACL_TABLE_CTRLPLANE) return false;
if (stage == ACL_STAGE_UNKNOWN) return false;
if (portSet.empty()) return false;
return true;
}
Expand All @@ -1019,12 +1020,6 @@ bool AclTable::create()
{
SWSS_LOG_ENTER();

if (stage == ACL_STAGE_UNKNOWN)
{
SWSS_LOG_ERROR("Unknown ACL stage for ACL table %s", id.c_str());
return false;
}

sai_attribute_t attr;
vector<sai_attribute_t> table_attrs;
vector<int32_t> bpoint_list = { SAI_ACL_BIND_POINT_TYPE_PORT, SAI_ACL_BIND_POINT_TYPE_LAG };
Expand Down

0 comments on commit 0faf02b

Please # to comment.