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

iptc.errors.XTablesError: can't find target response on iptc.easy.dump_table('filter', ipv6=False) and others #324

Open
dazwin opened this issue Mar 2, 2022 · 0 comments

Comments

@dazwin
Copy link

dazwin commented Mar 2, 2022

Environment:

  • OpenWRT 19.07
  • iptables v1.8.3 (legacy)

Sample code:

import os

os.environ['XTABLES_LIBDIR'] = "/usr/lib/iptables"
os.environ['PYTHON_IPTABLES_XTABLES_VERSION'] = "12"
import iptc

print(iptc.easy.dump_table('filter', ipv6=False))

Full result:

Traceback (most recent call last):
  File "python-iptables-cli.py", line 10, in <module>
    print(iptc.easy.dump_table('filter', ipv6=False))
  File "/usr/lib/python3.7/site-packages/iptc/easy.py", line 208, in dump_table
  File "/usr/lib/python3.7/site-packages/iptc/easy.py", line 208, in <dictcomp>
  File "/usr/lib/python3.7/site-packages/iptc/easy.py", line 213, in dump_chain
  File "/usr/lib/python3.7/site-packages/iptc/ip4tc.py", line 1518, in _get_rules
  File "/usr/lib/python3.7/site-packages/iptc/ip4tc.py", line 1518, in <listcomp>
  File "/usr/lib/python3.7/site-packages/iptc/ip4tc.py", line 1834, in create_rule
  File "/usr/lib/python3.7/site-packages/iptc/ip4tc.py", line 957, in __init__
  File "/usr/lib/python3.7/site-packages/iptc/ip4tc.py", line 1369, in _set_rule
  File "/usr/lib/python3.7/site-packages/iptc/ip4tc.py", line 728, in __init__
iptc.errors.XTablesError: can't find target

The problem appears to be that python-iptables is trying to load libxt_standard.so. This file does not exist on OpenWRT. I believe it is built-in module and so the assumption is that python-iptables should recognize this and not fail.

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

No branches or pull requests

1 participant