sndrcv does not return control to user after KeyboardInterrupt
Brief description
sndrcv related functions (sr, sr1, srp...) do not return control to the user after a KeyboardInterrupt.
Scapy version
2.5.0
Python version
3.12.2
Operating system
Windows 10
Additional environment information
No response
How to reproduce
p = IP(dst="X.X.X.X")/ICMP() sr1(p) ^C does not end process
Actual result
No response
Expected result
KeyboardInterrupt should quit the process.
Related resources
No response
Hi, could you retry on master?
Bug is still present on latest pull from master. Tried on Ethernet and Wireless NetworkInterfaces and issue is present on both.
I'm not sure that this is fixable. We use windows native WaitForMultipleObjects to wait for incoming packets which... you can't cancel from within Python. This is a limitation we can't really work around without compromising on select() performance.
The workaround would probably be to use a timeout parameter. Like timeout=1.