Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't set xtables_{matches,targets} to NULL. #299

Merged
merged 1 commit into from
Feb 18, 2020
Merged

Conversation

chruss2
Copy link
Contributor

@chruss2 chruss2 commented Feb 17, 2020

Protocol-independent extensions will be looked up once for each protocol
and added to the protocol-specific cache.

Fixes #282.

Protocol-independent extensions will be looked up once for each protocol
and added to the protocol-specific cache.

Fixes ldx#282.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 58.507% when pulling 282c790 on chruss2:master into 7fe9a99 on ldx:master.

@ldx
Copy link
Owner

ldx commented Feb 18, 2020

Interesting, do you have some example code that can reproduce the original issue in #282?

@chruss2
Copy link
Contributor Author

chruss2 commented Feb 18, 2020

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\")"'

@ldx
Copy link
Owner

ldx commented Feb 18, 2020

Looks good, thanks! 👍

@a-martynovich
Copy link

a-martynovich commented Apr 2, 2020

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.

@ldx
Copy link
Owner

ldx commented Apr 2, 2020

I have 1.6.0 and not seeing this problem, any chance you can provide some example code that reproduces the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'python-iptables: match "state" already registered' when creating rule with match state in ip4 and ip6
4 participants