Package: python-scapy
Version: 2.2.0-1
Severity: normal

Dear Maintainer,

This is the current code of scapy.all.PcapWriter._write_header:

    def _write_header(self, pkt):
        if self.linktype == None:
            if type(pkt) is list or type(pkt) is tuple or
isinstance(pkt,BasePacketList):
                pkt = pkt[0]
            try:
                self.linktype = conf.l2types[pkt.__class__]
            except KeyError:
                warning("PcapWriter: unknown LL type for %s. Using type 1
(Ethernet)" % pkt.__class__.__name__)
                self.linktype = 1

When passing a generator object, the first if statement evaluates to False
(which shouldn't) and an exception is raised when attempting to access
conf.l2types[pkt.__class__] since pkt.__class__ is <type 'generator'>.
Therefore, the except clause of the try-except code block is executed and
linktype is set to 1.



-- System Information:
Debian Release: jessie/sid
  APT prefers trusty-updates
  APT policy: (500, 'trusty-updates'), (500, 'trusty-security'), (500, 'trusty')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13.0-43-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-scapy depends on:
ii  python     2.7.5-5ubuntu3
ii  python2.7  2.7.6-8

python-scapy recommends no packages.

Versions of packages python-scapy suggests:
pn  ebtables        <none>
pn  graphviz        <none>
pn  gv              <none>
pn  hexer           <none>
pn  imagemagick     <none>
pn  librsvg2-bin    <none>
ii  python-crypto   2.6.1-4build1
pn  python-gnuplot  <none>
ii  python-pcapy    0.10.8-1build1
pn  python-pyx      <none>
pn  python-visual   <none>
pn  sox             <none>
ii  tcpdump         4.5.1-2ubuntu1.1
ii  tcpreplay       3.4.4-2
ii  wireshark       1.10.6-1
pn  xpdf            <none>

-- no debconf information


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to