From 8576eb63be49e8199b3c9166dfd4d2cd6703ac44 Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Mon, 24 Jan 2022 10:27:09 +0000 Subject: [PATCH 1/3] Fix the issue of uncleaned cacl rules if there are multiple cacl tables are deleted at the same time Signed-off-by: Zhaohui Sun --- src/sonic-host-services/scripts/caclmgrd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sonic-host-services/scripts/caclmgrd b/src/sonic-host-services/scripts/caclmgrd index 77bcd2e4ee7a..b7b5c12ffeb3 100755 --- a/src/sonic-host-services/scripts/caclmgrd +++ b/src/sonic-host-services/scripts/caclmgrd @@ -84,7 +84,7 @@ class ControlPlaneAclManager(daemon_base.DaemonBase): } } - UPDATE_DELAY_SECS = 0.5 + UPDATE_DELAY_SECS = 1 DualToR = False @@ -288,6 +288,8 @@ class ControlPlaneAclManager(daemon_base.DaemonBase): for acl_service in self.ACL_SERVICES: if self.ACL_SERVICES[acl_service]["multi_asic_ns_to_host_fwd"]: # Get the Source IP Set if exists else use default source ip prefix + if acl_service not in acl_source_ip_map: + continue nat_source_ipv4_set = acl_source_ip_map[acl_service]["ipv4"] if acl_source_ip_map and acl_source_ip_map[acl_service]["ipv4"] else { "0.0.0.0/0" } nat_source_ipv6_set = acl_source_ip_map[acl_service]["ipv6"] if acl_source_ip_map and acl_source_ip_map[acl_service]["ipv6"] else { "::/0" } From 401530f2d7022f409949ea596ea04dcf4450487e Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Tue, 25 Jan 2022 03:30:26 +0000 Subject: [PATCH 2/3] miss the scenario when acl_source_ip_map is empty Signed-off-by: Zhaohui Sun --- src/sonic-host-services/scripts/caclmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services/scripts/caclmgrd b/src/sonic-host-services/scripts/caclmgrd index b7b5c12ffeb3..d465b6f28e9c 100755 --- a/src/sonic-host-services/scripts/caclmgrd +++ b/src/sonic-host-services/scripts/caclmgrd @@ -288,7 +288,7 @@ class ControlPlaneAclManager(daemon_base.DaemonBase): for acl_service in self.ACL_SERVICES: if self.ACL_SERVICES[acl_service]["multi_asic_ns_to_host_fwd"]: # Get the Source IP Set if exists else use default source ip prefix - if acl_service not in acl_source_ip_map: + if acl_source_ip_map and acl_service not in acl_source_ip_map: continue nat_source_ipv4_set = acl_source_ip_map[acl_service]["ipv4"] if acl_source_ip_map and acl_source_ip_map[acl_service]["ipv4"] else { "0.0.0.0/0" } nat_source_ipv6_set = acl_source_ip_map[acl_service]["ipv6"] if acl_source_ip_map and acl_source_ip_map[acl_service]["ipv6"] else { "::/0" } From 46cba617d1b53513f6344f28124587dc35d36246 Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Mon, 27 Jun 2022 01:56:42 +0000 Subject: [PATCH 3/3] Only fix traceback issue Signed-off-by: Zhaohui Sun --- src/sonic-host-services/scripts/caclmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services/scripts/caclmgrd b/src/sonic-host-services/scripts/caclmgrd index d465b6f28e9c..569036a6d8ac 100755 --- a/src/sonic-host-services/scripts/caclmgrd +++ b/src/sonic-host-services/scripts/caclmgrd @@ -84,7 +84,7 @@ class ControlPlaneAclManager(daemon_base.DaemonBase): } } - UPDATE_DELAY_SECS = 1 + UPDATE_DELAY_SECS = 0.5 DualToR = False