Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sndrcv does not return control to user after KeyboardInterrupt #4341

Open
bsullivan19 opened this issue Mar 28, 2024 · 3 comments
Open

sndrcv does not return control to user after KeyboardInterrupt #4341

bsullivan19 opened this issue Mar 28, 2024 · 3 comments

Comments

@bsullivan19
Copy link
Contributor

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

@gpotter2
Copy link
Member

Hi, could you retry on master?

@bsullivan19
Copy link
Contributor Author

Bug is still present on latest pull from master. Tried on Ethernet and Wireless NetworkInterfaces and issue is present on both.

@gpotter2
Copy link
Member

gpotter2 commented Apr 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants