Skip to content

Commit

Permalink
Catch exceptions on arpmonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
mfontanini committed Dec 26, 2015
1 parent 45546ee commit 3621610
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions examples/arpmonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,14 @@ int main(int argc, char *argv[])
config.set_promisc_mode(true);
config.set_filter("arp");

// Sniff on the provided interface in promiscuous mode
Sniffer sniffer(argv[1], config);

// Only capture arp packets
monitor.run(sniffer);
try {
// Sniff on the provided interface in promiscuous mode
Sniffer sniffer(argv[1], config);

// Only capture arp packets
monitor.run(sniffer);
}
catch (std::exception& ex) {
std::cerr << "Error: " << ex.what() << std::endl;
}
}

0 comments on commit 3621610

Please sign in to comment.