Skip to content

Commit

Permalink
[aclorch]: Fix matching MIRROR_DSCP throws unnecessary errors (#966)
Browse files Browse the repository at this point in the history
First check if the string to compare is a match action and then
check if the match action is MATCH_DSCP.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
  • Loading branch information
stcheng committed Jul 3, 2019
1 parent 80fcada commit bd3651f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,9 @@ bool AclRuleMirror::validateAddMatch(string attr_name, string attr_value)
return false;
}

if ((m_tableType == ACL_TABLE_MIRROR_DSCP && attr_name != MATCH_DSCP))
if ((m_tableType == ACL_TABLE_MIRROR_DSCP &&
aclMatchLookup.find(attr_name) != aclMatchLookup.end() &&
attr_name != MATCH_DSCP))
{
SWSS_LOG_ERROR("%s match is not supported for the table of type MIRROR_DSCP",
attr_name.c_str());
Expand Down

0 comments on commit bd3651f

Please sign in to comment.