【问题标题】:Undefined symbol "afinfo" when importing python-iptables package "iptc"导入 python-iptables 包“iptc”时未定义符号“afinfo”
【发布时间】:2013-05-12 04:21:53
【问题描述】:

我正在尝试利用 python-iptables 包在 Web 应用程序中列出 iptables 规则。当我将 iptc 包添加到我的环境中时,出现以下错误。我使用 yum 'provides' 来查找 libxtables.so.4 文件的来源,发现 iptablesiptables-devel 软件包是 CentOS 6.4 x64 中的合适选择。我升级了这些软件包,但并没有改变错误。

有人对我如何解决这个问题有任何建议吗?


pgrace@ny-misc01:~/repos/python-iptables/libxtwrapper$ python
Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import iptc
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.6/site-packages/iptc/__init__.py", line 10, in 
    from ip4tc import Table, Chain, Rule, Match, Target, Policy, IPTCError
  File "/usr/lib64/python2.6/site-packages/iptc/ip4tc.py", line 11, in 
    from xtables import (XT_INV_PROTO, NFPROTO_IPV4, XTablesError, xtables,
  File "/usr/lib64/python2.6/site-packages/iptc/xtables.py", line 744, in 
    class xtables(object):
  File "/usr/lib64/python2.6/site-packages/iptc/xtables.py", line 757, in xtables
    _xtables_afinfo = ct.c_void_p.in_dll(_lib_xtables, "afinfo")
ValueError: /lib64/libxtables.so.4: undefined symbol: afinfo
>>>

【问题讨论】:

  • 我在 Ubuntu 11 中遇到了这个问题,但在 Ubuntu 12 中没有

标签: python iptables


【解决方案1】:

看到这个:https://github.com/ldx/python-iptables/issues/25

这是一个已知问题,旧版本的 libxtables 将 afinfo 声明为静态,因此 python-iptables 无法访问它。不过,有一个可能的解决方法 - 请密切关注工单,一旦有进展就会更新。

另一个解决方案是更新您机器上的 iptables。

免责声明:我是 python-iptables 的维护者。

更新:现在应该修复了。

【讨论】:

    猜你喜欢
    • 2019-08-17
    • 2016-02-03
    • 2014-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多