From 71f739d005251c4997e4120f8a385de827afe3f4 Mon Sep 17 00:00:00 2001 From: bingwang Date: Mon, 27 Jun 2022 07:42:42 +0000 Subject: [PATCH] Fix mux_acl_rule adding issue Signed-off-by: bingwang --- orchagent/aclorch.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/orchagent/aclorch.cpp b/orchagent/aclorch.cpp index ddeca7adf4..331a11dbda 100644 --- a/orchagent/aclorch.cpp +++ b/orchagent/aclorch.cpp @@ -3694,7 +3694,14 @@ bool AclOrch::addAclTable(AclTable &newTable) return true; } } - + // Update matching field according to ACL stage + newTable.addStageMandatoryMatchFields(); + + // Add mandatory ACL action if not present + // We need to call addMandatoryActions here because addAclTable is directly called in other orchs. + // The action_list is already added if the ACL table creation is triggered by CONFIGDD, but calling addMandatoryActions + // twice will make no effect + newTable.addMandatoryActions(); if (createBindAclTable(newTable, table_oid)) { m_AclTables[table_oid] = newTable; @@ -4171,11 +4178,8 @@ void AclOrch::doAclTableTask(Consumer &consumer) } newTable.validateAddType(*tableType); - - newTable.addStageMandatoryMatchFields(); - + // Add mandatory ACL action if not present newTable.addMandatoryActions(); - // validate and create/update ACL Table if (bAllAttributesOk && newTable.validate()) {