Skip to content

Commit de54082

Browse files
authored
Merge pull request #16 from ZhaohuiS/feature/caclmgrd_external_client_warning_log
In #9 , I added a new EXTERNAL_CLIENT table for supporting Restapi/gnmi control plane acls. But if dest port is not defined, it will print traceback in syslog. Avoiding this scenario, we add a default empty list for dst_ports and print a warning log and skip processing EXTERNAL_CLIENT table. Signed-off-by: Zhaohui Sun [email protected]
2 parents 91c4c42 + b4b368d commit de54082

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/caclmgrd

+8
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,8 @@ class ControlPlaneAclManager(daemon_base.DaemonBase):
551551
ip_protocols = self.ACL_SERVICES[acl_service]["ip_protocols"]
552552
if "dst_ports" in self.ACL_SERVICES[acl_service]:
553553
dst_ports = self.ACL_SERVICES[acl_service]["dst_ports"]
554+
else:
555+
dst_ports = []
554556

555557
acl_rules = {}
556558

@@ -604,6 +606,12 @@ class ControlPlaneAclManager(daemon_base.DaemonBase):
604606
self.log_warning("Unable to determine if ACL table '{}' contains IPv4 or IPv6 rules. Skipping table..."
605607
.format(table_name))
606608
continue
609+
# If no destination port found for this ACL table,
610+
# log a message and skip processing this table.
611+
if len(dst_ports) == 0:
612+
self.log_warning("Required destination port not found for ACL table '{}'. Skipping table..."
613+
.format(table_name))
614+
continue
607615
ipv4_src_ip_set = set()
608616
ipv6_src_ip_set = set()
609617
# For each ACL rule in this table (in descending order of priority)

0 commit comments

Comments
 (0)