Skip to content

Commit

Permalink
sniff function in try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
danimtb authored Feb 26, 2018
1 parent 34ed511 commit 43e0ce8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dasshio/dasshio.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@ def arp_display(pkt):
while True:
# Start sniffing
logging.info("Starting sniffing...")
sniff(stop_filter=arp_display,
filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)", store=0, count=0)
try:
sniff(stop_filter=arp_display,
filter="arp or (udp and src port 68 and dst port 67 and src host 0.0.0.0)",
store=0,
count=0)
except(OSError):
pass
timeout = config["timeout"]
logging.info("Packet captured, waiting " + str(timeout) + "s ...")
time.sleep(timeout)

0 comments on commit 43e0ce8

Please sign in to comment.