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

xtables symbol error with Debian 6 #30

Closed
nosmo opened this issue Jul 5, 2013 · 4 comments
Closed

xtables symbol error with Debian 6 #30

nosmo opened this issue Jul 5, 2013 · 4 comments

Comments

@nosmo
Copy link

nosmo commented Jul 5, 2013

Hey there,

Big fan of the module. I've been developing on Debian 7 with no problems, but I've had to make my code compatible with Debian 6. Unfortunately Debian 6's xtables seems to lack the xtables_pending_matches (and xtables_pending_targets) symbol and this causes iptc to fail to import as follows:

>>> import iptc
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 10, in 
    from ip4tc import (is_table_available, Table, Chain, Rule, Match, Target,
  File "/usr/local/lib/python2.6/dist-packages/iptc/ip4tc.py", line 12, in 
    from xtables import (XT_INV_PROTO, NFPROTO_IPV4, XTablesError, xtables,
  File "/usr/local/lib/python2.6/dist-packages/iptc/xtables.py", line 746, in 
    class xtables(object):
  File "/usr/local/lib/python2.6/dist-packages/iptc/xtables.py", line 766, in xtables
    "xtables_pending_matches"))
ValueError: /lib/libxtables.so.4: undefined symbol: xtables_pending_matches
>>>

I'm trying to backport Wheezy's xtables packages, but can python-iptables function without this symbol? I've commented the references to it out and I don't seem to be hitting any major issues but I'm curious/worried as to whether this will bite me further down the line. For reference this issue appears in the current git HEAD.
Thanks!

@ldx
Copy link
Owner

ldx commented Jul 5, 2013

If the test suite does not complain then you're probably fine. Is it only xtables_pending_matches(), or xtables_pending_targets() too missing from libxtables?

@nosmo
Copy link
Author

nosmo commented Jul 5, 2013

Both xtables_pending_matches and xtables_pending_targets are missing from the object file

The test suite returns three failures:

======================================================================
ERROR: test_target_parameters (iptc.test.test_targets.TestTarget)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/python-iptables/iptc/test/test_targets.py", line 45, in test_target_parameters
    t.nfmask = "0xdeadbeef"
  File "/root/python-iptables/iptc/ip4tc.py", line 358, in __setattr__
    self.parse(name.replace("_", "-"), value)
  File "/root/python-iptables/iptc/ip4tc.py", line 277, in parse
    self._parse(argv, inv, entry)
  File "/root/python-iptables/iptc/ip4tc.py", line 596, in _parse
    ct.cast(self._ptrptr, ct.POINTER(ct.c_void_p)))
  File "/root/python-iptables/iptc/xtables.py", line 737, in new
    ret = fn(*args)
  File "/root/python-iptables/iptc/xtables.py", line 987, in parse_target
    self._parse(t, argv, invert, flags, fw, ptr)
  File "/root/python-iptables/iptc/xtables.py", line 939, in _parse
    raise ValueError("invalid value %s" % (argv[1]))
ValueError: invalid value 0xdeadbeef
======================================================================
ERROR: test_insert (iptc.test.test_targets.TestXTClusteripTarget)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/python-iptables/iptc/test/test_targets.py", line 104, in test_insert
    self.target.hashmode = "sourceip"
  File "/root/python-iptables/iptc/ip4tc.py", line 358, in __setattr__
    self.parse(name.replace("_", "-"), value)
  File "/root/python-iptables/iptc/ip4tc.py", line 277, in parse
    self._parse(argv, inv, entry)
  File "/root/python-iptables/iptc/ip4tc.py", line 596, in _parse
    ct.cast(self._ptrptr, ct.POINTER(ct.c_void_p)))
  File "/root/python-iptables/iptc/xtables.py", line 737, in new
    ret = fn(*args)
  File "/root/python-iptables/iptc/xtables.py", line 987, in parse_target
    self._parse(t, argv, invert, flags, fw, ptr)
  File "/root/python-iptables/iptc/xtables.py", line 939, in _parse
    raise ValueError("invalid value %s" % (argv[1]))
ValueError: invalid value sourceip
======================================================================
ERROR: test_mode (iptc.test.test_targets.TestXTClusteripTarget)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/python-iptables/iptc/test/test_targets.py", line 88, in test_mode
    self.target.hashmode = hashmode
  File "/root/python-iptables/iptc/ip4tc.py", line 358, in __setattr__
    self.parse(name.replace("_", "-"), value)
  File "/root/python-iptables/iptc/ip4tc.py", line 277, in parse
    self._parse(argv, inv, entry)
  File "/root/python-iptables/iptc/ip4tc.py", line 596, in _parse
    ct.cast(self._ptrptr, ct.POINTER(ct.c_void_p)))
  File "/root/python-iptables/iptc/xtables.py", line 737, in new
    ret = fn(*args)
  File "/root/python-iptables/iptc/xtables.py", line 987, in parse_target
    self._parse(t, argv, invert, flags, fw, ptr)
  File "/root/python-iptables/iptc/xtables.py", line 939, in _parse
    raise ValueError("invalid value %s" % (argv[1]))
ValueError: invalid value sourceip
----------------------------------------------------------------------

@ldx
Copy link
Owner

ldx commented Jul 5, 2013

These should be okay - you just have an old revision of these two extensions, not accepting certain values or lacking features.

@nosmo
Copy link
Author

nosmo commented Jul 5, 2013

Awesome, thanks for clearing that up! :) I'll close this out, thanks for the help.

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

2 participants