[caclmgrd] Fix application of IPv6 service ACL rules #3917
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Caclmgrd was written with the understanding that the "SRC_IP" field of the rule properties would contain either a v4 or v6 IP address, thus we examined the IP address in that field to make an educated guess as to whether the table which contained that rule contained v4 or v6 addresses.
However, this PR: sonic-net/sonic-utilities#377 broke the logic in caclmgrd, because it now causes the acl-loader application to perform the same check and if the IP address is a v4 address, it inserts it into the "SRC_IP" field as it did previously. However, if the IP address is a v6 address, it inserts the address into a new "SRC_IPV6" field, leaving the "SRC_IP" field empty, which caused the logic in caclmgrd to fail to determine tables which contain IPv6 addresses, therefore not applying IPv6 service ACLs. This was noticed via log messages like the following:
This PR now adapts to the new acl-loader logic, and determines whether the table contains v4 or v6 address based on whether the rules in the table contain "SRC_IP"/"DST_IP" fields (v4), or "SRC_IPV6"/"DST_IPV6" fields (v6).