dump: capture in promisc mode by default, with an option to disable it
Change-Id: I75d9580616f0af588291897b27fe376921fef11f
diff --git a/tools/dump/main.cpp b/tools/dump/main.cpp
index 25a0226..ebec765 100644
--- a/tools/dump/main.cpp
+++ b/tools/dump/main.cpp
@@ -73,7 +73,8 @@
"read packets from the specified file; use \"-\" to read from standard input")
("filter,f", po::value<std::string>(&nameFilter),
"print packet only if name matches this regular expression")
- ("verbose,v", po::bool_switch(&instance.isVerbose),
+ ("no-promiscuous-mode,p", po::bool_switch(), "do not put the interface into promiscuous mode")
+ ("verbose,v", po::bool_switch(&instance.wantVerbose),
"print more detailed information about each packet")
("version,V", "print program version and exit")
;
@@ -138,6 +139,8 @@
instance.pcapFilter = os.str();
}
+ instance.wantPromisc = !vm["no-promiscuous-mode"].as<bool>();
+
try {
instance.run();
}