Skip to content

Commit 3dc5a88

Browse files
committed
Fix AsyncSniffer Attribute Error
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]>
1 parent b54fdb7 commit 3dc5a88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scapy/sendrecv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ def stop(self, join=True):
14011401
"""Stops AsyncSniffer if not in async mode"""
14021402
if self.running:
14031403
self.stop_cb()
1404-
if self.continue_sniff:
1404+
if not hasattr(self, "continue_sniff") or self.continue_sniff:
14051405
raise Scapy_Exception(
14061406
"Unsupported (offline or unsupported socket)"
14071407
)

0 commit comments

Comments
 (0)