Closed chruss2 closed 4 years ago
Interesting, do you have some example code that can reproduce the original issue in #282?
Sure. It requires a fairly recent libxtables, so alpine 3.10 is an easy way to reproduce it. Here is a docker one-liner.
docker run --privileged alpine:3.10 sh -c 'apk add python3-dev alpine-sdk iptables ip6tables; pip3 install python-iptables; XTABLES_LIBDIR=/usr/lib/xtables python3 -c "import sys; import iptc; match = iptc.Match(iptc.Rule(), \"addrtype\"); match6 = iptc.Match(iptc.Rule6(), \"addrtype\")"'
Looks good, thanks! :+1:
This patch leads to a freeze with 100% CPU usage with iptables older than 1.8.0. Try it on Ubuntu 18.04 for instance. This patch needs to be applied only if iptables is 1.8.0 or newer.
I have 1.6.0 and not seeing this problem, any chance you can provide some example code that reproduces the issue?
Protocol-independent extensions will be looked up once for each protocol and added to the protocol-specific cache.
Fixes #282.