Skip to content

Commit fbe781d

Browse files
authored
Add support for handling control plane ACLs (sonic-net#416)
1 parent a043a55 commit fbe781d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

orchagent/aclorch.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ acl_rule_attr_lookup_t aclL3ActionLookup =
5252

5353
static acl_table_type_lookup_t aclTableTypeLookUp =
5454
{
55-
{ TABLE_TYPE_L3, ACL_TABLE_L3 },
56-
{ TABLE_TYPE_MIRROR, ACL_TABLE_MIRROR }
55+
{ TABLE_TYPE_L3, ACL_TABLE_L3 },
56+
{ TABLE_TYPE_MIRROR, ACL_TABLE_MIRROR },
57+
{ TABLE_TYPE_CTRLPLANE, ACL_TABLE_CTRLPLANE }
5758
};
5859

5960
static acl_stage_type_lookup_t aclStageLookUp =
@@ -856,7 +857,8 @@ void AclRuleMirror::update(SubjectType type, void *cntx)
856857

857858
bool AclTable::validate()
858859
{
859-
if (type == ACL_TABLE_UNKNOWN) return false;
860+
// Control plane ACLs are handled by a separate process
861+
if (type == ACL_TABLE_UNKNOWN || type == ACL_TABLE_CTRLPLANE) return false;
860862
if (ports.empty()) return false;
861863
return true;
862864
}

orchagent/aclorch.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
#define TABLE_TYPE "TYPE"
2323
#define TABLE_PORTS "PORTS"
2424

25-
#define TABLE_TYPE_L3 "L3"
26-
#define TABLE_TYPE_MIRROR "MIRROR"
25+
#define TABLE_TYPE_L3 "L3"
26+
#define TABLE_TYPE_MIRROR "MIRROR"
27+
#define TABLE_TYPE_CTRLPLANE "CTRLPLANE"
2728

2829
#define RULE_PRIORITY "PRIORITY"
2930
#define MATCH_SRC_IP "SRC_IP"
@@ -63,7 +64,8 @@ typedef enum
6364
{
6465
ACL_TABLE_UNKNOWN,
6566
ACL_TABLE_L3,
66-
ACL_TABLE_MIRROR
67+
ACL_TABLE_MIRROR,
68+
ACL_TABLE_CTRLPLANE
6769
} acl_table_type_t;
6870

6971
typedef map<string, acl_table_type_t> acl_table_type_lookup_t;

0 commit comments

Comments
 (0)