Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scapy/sendrecv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,11 @@ def stop(self, join=True):
"""Stops AsyncSniffer if not in async mode"""
if self.running:
self.stop_cb()
if not hasattr(self, "continue_sniff"):
# Never started -> is there an exception?
if self.exception is not None:
raise self.exception
return None
if self.continue_sniff:
raise Scapy_Exception(
"Unsupported (offline or unsupported socket)"
Expand Down
9 changes: 9 additions & 0 deletions test/regression.uts
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,15 @@ try:
except ValueError:
assert True

try:
sniffer = AsyncSniffer(iface="this_interface_does_not_exists")
sniffer.start()
sniffer.thread.join()
sniffer.stop()
assert False, "Should have errored by now"
except ValueError:
assert True

= Sending a TCP syn 'forever' at layer 2 and layer 3
~ netaccess needs_root IP
def _test():
Expand Down
Loading