File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1401,7 +1401,12 @@ def stop(self, join=True):
14011401 """Stops AsyncSniffer if not in async mode"""
14021402 if self .running :
14031403 self .stop_cb ()
1404- if not hasattr (self , "continue_sniff" ) or self .continue_sniff :
1404+ if not hasattr (self , "continue_sniff" ):
1405+ # Never started -> is there an exception?
1406+ if self .exception is not None :
1407+ raise self .exception
1408+ return
1409+ if self .continue_sniff :
14051410 raise Scapy_Exception (
14061411 "Unsupported (offline or unsupported socket)"
14071412 )
Original file line number Diff line number Diff line change @@ -1787,6 +1787,14 @@ try:
17871787except ValueError:
17881788 assert True
17891789
1790+ try:
1791+ sniffer = AsyncSniffer(iface="this_interface_does_not_exists")
1792+ sniffer.start()
1793+ sniffer.stop()
1794+ assert False, "Should have errored by now"
1795+ except ValueError:
1796+ assert True
1797+
17901798= Sending a TCP syn 'forever' at layer 2 and layer 3
17911799~ netaccess needs_root IP
17921800def _test():
You can’t perform that action at this time.
0 commit comments