Damans227 commented on code in PR #14350:
URL: https://github.com/apache/cloudstack/pull/14350#discussion_r4259283022
##########
systemvm/debian/opt/cloud/bin/configure.py:
##########
@@ -583,16 +592,21 @@ def process(self, direction, rule_list, base, is_routed):
count = base
for i in rule_list:
- ruleData = copy.copy(i)
- cidr = ruleData['cidr']
+ cidr = i['cidr']
if cidr is not None and cidr != "":
cidr = removeUndesiredCidrs(cidr, 6)
if cidr is None or cidr == "":
continue
- ruleData['cidr'] = cidr
- r = self.AclRule(direction, self, ruleData, self.config, count)
- r.create()
- count += 1
+ # iptables expands "-s a,b" into one rule per address, but
CsNetfilters
+ # counts each entry as a single rule when placing the next ACL
rule ahead
+ # of the DROP. Emit one entry per CIDR so the two stay in step.
+ cidrs = [c for c in cidr.split(",") if c] if cidr else [cidr]
+ for c in cidrs:
Review Comment:
did you check how long an apply takes with a few hundred cidrs in one rule?
each cidr is now its own iptables call, plus one more to remove the old one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]