Your message dated Sat, 19 Oct 2019 11:36:03 +0200
with message-id <[email protected]>
and subject line Re: python-scapy: scapy.all.PcapWriter doesn't handle a
generator object that yields packets
has caused the Debian Bug report #774960,
regarding python-scapy: scapy.all.PcapWriter doesn't handle a generator object
that yields packets
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
774960: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=774960
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
This issue is fixed as of 2.4.3.
```
>>> wrpcap("a.pcap", (x for x in [Ether()/IP(), Ether()/IP()/UDP()]))
>>> rdpcap("a.pcap")
<a.pcap: TCP:0 UDP:1 ICMP:0 Other:1>
```
Thank you.
Gabriel
> On Fri, 09 Jan 2015 15:30:44 +0200 Yoel wrote:
> 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 .
> 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
> pn graphviz
> pn gv
> pn hexer
> pn imagemagick
> pn librsvg2-bin
> ii python-crypto 2.6.1-4build1
> pn python-gnuplot
> ii python-pcapy 0.10.8-1build1
> pn python-pyx
> pn python-visual
> pn sox
> ii tcpdump 4.5.1-2ubuntu1.1
> ii tcpreplay 3.4.4-2
--- End Message ---