Skip to content

Commit

Permalink
Merge pull request #328 from guedou/PR#200_improved
Browse files Browse the repository at this point in the history
Stop sniff() on empty s.recv()
  • Loading branch information
p-l- committed Nov 3, 2016
2 parents 7f45014 + d4a09f4 commit 6831cab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scapy/sendrecv.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,10 @@ def sniff(count=0, store=1, offline=None, prn=None, lfilter=None,
sel = select(sniff_sockets, [], [], remain)
for s in sel[0]:
p = s.recv()
if p is not None:
if p is None and offline is not None:
stop_event = True
break
elif p is not None:
if lfilter and not lfilter(p):
continue
if s in label:
Expand Down

0 comments on commit 6831cab

Please sign in to comment.