[pypy-issue] [issue1318] Scapy.sniff returns an error

Yuriy tracker at bugs.pypy.org
Fri Nov 9 16:32:44 CET 2012


New submission from Yuriy <yuriym at toroki.com>:

When I try to sniff stp packets using Scapy, I get an 'Invalid argument' error.

Steps:

ttt at ttt:~/Downloads/scapy/scapy-2.1.0$ sudo pypy
Python 2.7.2 (341e1e3821fff77db3bb5cdb7a4851626298c44e, Nov 08 2012, 17:01:35)
[PyPy 1.9.0 with GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``"[it] just shows again that
rpython is obscure" (cfbolz)''
>>>> import scapy.all as scapy
WARNING: No route found for IPv6 destination :: (no default route?)
>>>> scapy.sniff(iface="eth1", filter="stp", prn=lambda x: x.display)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "scapy/sendrecv.py", line 550, in sniff
    s = L2socket(type=ETH_P_ALL, *arg, **karg)
  File "scapy/arch/linux.py", line 460, in __init__
    attach_filter(self.ins, filter)
  File "scapy/arch/linux.py", line 132, in attach_filter
    s.setsockopt(SOL_SOCKET, SO_ATTACH_FILTER, bpfh)
  File "<string>", line 1, in setsockopt
error: [Errno 22] Invalid argument

However it works with Python

----------
messages: 4972
nosy: pypy-issue, ymarkevy
priority: bug
status: unread
title: Scapy.sniff returns an error

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1318>
________________________________________


More information about the pypy-issue mailing list