ldx / python-iptables

Python bindings for iptables
730 stars 182 forks source link

Speed up code for arm architecture when creating new rules #341

Open jkklemm opened 10 months ago

jkklemm commented 10 months ago

Since the arm architecture is slow to always lookup the tables, the creation of many rules with standard targets like Accept or Reject can slow down the creation of firewall rules. For this reason, a dictionary is used to check available tables and standard targets are not check if they are a chain. This code can halve the execution time on an Arm architectures if many firewall rules are created.