Skip to content

Scapy not getting response in multithreaded app #778

@rafajot

Description

@rafajot

I'm wondering if there are any known issues with the scapy being used in multi-threaded applications.
Please refer to the attached scapy_multithreaded.py application. It has two functions: rtt_ip_ICMP(ip) and rtt_ip_UDP(ip) which send ICMP and UDP packets respectively to 127.0.0.1 (also with 127.0.0.1 srcip).
They work fine in single-thread application but in case of multi-threaded app lot of responses are missing.
Attaching python script as well as the output from command:
./scapy_multithreaded.py > scapy_multithreaded.txt

Scapy: 2.3.3
Linux 2.6.32-573.3.1.el6.x86_64 #1 SMP Thu Aug 13 22:55:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Python 2.7.6

BTW I noticed that the workaround for this issue might be changing in load_ips() function, line 41 ThreadPoolExecutor to ProcessPoolExecutor. Anyway I have a strong impression this is an indication of a bug in scapy.

scapy_multithreaded.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions