Stop when all listening sockets have closed
Otherwise, if select() is blocking, with a control socket (close_pipe) remaining in sniff_sockets, the loop will never terminate.
Checklist:
- [X] If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
- [X] I squashed commits belonging together
- [ ] I added unit tests or explained why they are not relevant
- [ ] I executed the regression tests for Python2 and Python3 (using
toxor,cd test && ./run_tests_py2, cd test && ./run_tests_py3) - [ ] If the PR is still not finished, please create a Draft Pull Request
If select() is blocking, with a control socket (close_pipe) remaining in sniff_sockets, the loop will never terminate. This change fixes that.
fixes #xxx
Thanks for the report. Good point although the proposed fix is rather inefficient. It would be best to compute this list (set?) only once
@qris Are you still pursuing this?
No, sorry, I'm not using Scapy at the moment.
This was fixed in https://github.com/secdev/scapy/pull/3663.