Skip to content

Exception in snifferthread when creating L2listen #6

Description

@jeremiahrex

After a registration is successfully confirmed, a sniffer thread is set up which creates a socket that listens for the appropriate ARP and TCP traffic. However something goes wrong when passing the compiled BPF filter code to setsockopt.

Exception in thread Thread-5: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/home/jerry/.local/lib/python2.7/site-packages/sleepproxy/sniff.py", line 18, in run self._sniff() File "/home/jerry/.local/lib/python2.7/site-packages/sleepproxy/sniff.py", line 24, in _sniff sock = conf.L2listen(type=ETH_P_ALL, filter=self._filterexp, iface=self._iface) File "/home/jerry/.local/lib/python2.7/site-packages/scapy/arch/linux.py", line 454, in __init__ attach_filter(self.ins, filter, iface) File "/home/jerry/.local/lib/python2.7/site-packages/scapy/arch/linux.py", line 141, in attach_filter sock.setsockopt(socket.SOL_SOCKET, SO_ATTACH_FILTER, bp) File "<string>", line 1, in setsockopt error: [Errno 22] Invalid argument

Running lubuntu 16.04.6 LTS on a Macmini G4.

I have confirmed that the BPF filters are being correctly generated in scapy. I suspect that it is a similar issue to secdev/scapy#842.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions