[Pkg-netmeasure-discuss] Bug#887804: python3-scapy: scapy.pton_ntop.inet_pton(socket.AF_INET6, '2000::') fails

Daniel Kahn Gillmor dkg at fifthhorseman.net
Sat Jan 20 03:26:26 UTC 2018


Package: python3-scapy
Version: 0.21-1
Severity: normal

In python2:

>>> import scapy.pton_ntop, socket
>>> scapy.pton_ntop.inet_pton(socket.AF_INET6, '2000::')
' \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>>

But in python3:

>>> import scapy.pton_ntop, socket
>>> scapy.pton_ntop.inet_pton(socket.AF_INET6, '2000::1')
hello
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/scapy/pton_ntop.py", line 24, in inet_pton
    while b"::" in addr:
TypeError: 'in <string>' requires string as left operand, not bytes
>>> 


the "hello" is particularly weird.  it comes from
/usr/lib/python3/dist-packages/scapy/pton_ntop.py:

def inet_pton(af, addr):
    """Convert an IP address from text representation into binary form"""
    print('hello')
…

but it also just shouldn't choke this way.

    --dkg

-- System Information:
Debian Release: buster/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing'), (500, 'oldstable'), (200, 'unstable-debug'), (200, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python3-scapy depends on:
ii  libjs-sphinxdoc  1.6.6-1
ii  python3          3.6.4-1
ii  python3.6        3.6.4-3
ii  tcpdump          4.9.2-2

python3-scapy recommends no packages.

Versions of packages python3-scapy suggests:
ii  ipython3            5.5.0-1
ii  python3-matplotlib  2.0.0+dfsg1-2+b1

-- no debconf information


More information about the Pkg-netmeasure-discuss mailing list