Scapy fails to sniff packets when using multiple threads

后端 未结 1 1105
猫巷女王i
猫巷女王i 2020-12-10 06:17

I\'ll try to demonstrate my problem with a simplified example.

Following is a very simple (single threaded) packet sniffer (ICMP):

from scapy.all imp         


        
1条回答
  •  粉色の甜心
    2020-12-10 06:39

    The main reason for this is most likely because of resource locks. Scapy's sniff() function probably have to lock on to low-level network resources in order to be able to sniff packets.

    Delaying the two threads (after starting the sniffer thread) you'll ensure that Scapy will get the time it needs to do so.

    To see how we came to this conclusion see the discussion above in the comment section. Gl Asiri Rathnayake :)

    0 讨论(0)
提交回复
热议问题