Skip to content

Commit bd3651f

Browse files
authored
[aclorch]: Fix matching MIRROR_DSCP throws unnecessary errors (#966)
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 <[email protected]>
1 parent 80fcada commit bd3651f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

orchagent/aclorch.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,9 @@ bool AclRuleMirror::validateAddMatch(string attr_name, string attr_value)
980980
return false;
981981
}
982982

983-
if ((m_tableType == ACL_TABLE_MIRROR_DSCP && attr_name != MATCH_DSCP))
983+
if ((m_tableType == ACL_TABLE_MIRROR_DSCP &&
984+
aclMatchLookup.find(attr_name) != aclMatchLookup.end() &&
985+
attr_name != MATCH_DSCP))
984986
{
985987
SWSS_LOG_ERROR("%s match is not supported for the table of type MIRROR_DSCP",
986988
attr_name.c_str());

0 commit comments

Comments
 (0)