Skip to content

Commit

Permalink
Add warning log if destination port is not defined
Browse files Browse the repository at this point in the history
Signed-off-by: Zhaohui Sun <[email protected]>
  • Loading branch information
ZhaohuiS committed Sep 4, 2022
1 parent 91c4c42 commit b4b368d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/caclmgrd
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ class ControlPlaneAclManager(daemon_base.DaemonBase):
ip_protocols = self.ACL_SERVICES[acl_service]["ip_protocols"]
if "dst_ports" in self.ACL_SERVICES[acl_service]:
dst_ports = self.ACL_SERVICES[acl_service]["dst_ports"]
else:
dst_ports = []

acl_rules = {}

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

0 comments on commit b4b368d

Please sign in to comment.