From bd3651fc5d57463f3bcd1ee4485b04280f072c03 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Wed, 3 Jul 2019 13:54:53 -0700 Subject: [PATCH] [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 --- orchagent/aclorch.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/orchagent/aclorch.cpp b/orchagent/aclorch.cpp index c721183d8631..51f8569933a4 100644 --- a/orchagent/aclorch.cpp +++ b/orchagent/aclorch.cpp @@ -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());