Skip to content

Fix AsyncSniffer Attribute Error #4800

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

louis-6wind
Copy link
Contributor

Fix scenario:

from scapy.all import AsyncSniffer
sniffer=AsyncSniffer(
... iface="br100",
... store=False,
... promisc=False,
... )
sniffer.start()
sniffer.stop()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.12/dist-packages/scapy/sendrecv.py", line 1404, in stop
if self.continue_sniff:
^^^^^^^^^^^^^^^^^^^
AttributeError: 'AsyncSniffer' object has no attribute 'continue_sniff'

Related to #4781 (comment)

Checklist:

  • If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • I squashed commits belonging together
  • I added unit tests or explained why they are not relevant
  • I executed the regression tests (using cd test && ./run_tests or tox)
  • If the PR is still not finished, please create a Draft Pull Request

fixes #xxx

Fix scenario:

> >>> from scapy.all import AsyncSniffer
> >>> sniffer=AsyncSniffer(
> ...     iface="br100",
> ...     store=False,
> ...     promisc=False,
> ... )
> >>> sniffer.start()
> >>> sniffer.stop()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/local/lib/python3.12/dist-packages/scapy/sendrecv.py", line 1404, in stop
>     if self.continue_sniff:
>        ^^^^^^^^^^^^^^^^^^^
> AttributeError: 'AsyncSniffer' object has no attribute 'continue_sniff'

Signed-off-by: Louis Scalbert <[email protected]>
Copy link

codecov bot commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.03%. Comparing base (b54fdb7) to head (3dc5a88).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4800      +/-   ##
==========================================
+ Coverage   80.08%   81.03%   +0.95%     
==========================================
  Files         365      365              
  Lines       89027    89027              
==========================================
+ Hits        71296    72143     +847     
+ Misses      17731    16884     -847     
Files with missing lines Coverage Δ
scapy/sendrecv.py 86.53% <100.00%> (ø)

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

1 participant