aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-07-22 16:53:18 -0700
committerGuy Harris <guy@alum.mit.edu>2014-07-22 23:53:49 +0000
commitf6ce0cdacd642d31cf198d0bdc4654bbd5afd951 (patch)
treeea1cabe3d37f686171cb3fb273595eafe04d163a /capture_opts.c
parent4261109e1e15ec16b3d38df9e6011d676a558487 (diff)
Get rid of NO_INTERFACES_FOUND - it's not an error.
It just means "pcap didn't give me any interfaces, and didn't report an error". Hopefully, in the future, there will be pcap APIs that distinguish between the (admittedly unlikely, these days) case of "there really *are* no interfaces on which *anybody* can capture" and "you don't have sufficient permission to capture", and we can report the latter as an error. (Given that pcap supports more than just "regular interfaces", though, there are cases where you don't have permission to capture on those but you have permission to capture raw USB traffic, for example, so perhaps what's really needed is per-interface indications of permissions.) Change-Id: I7b8abb0829e8502f5259c95e8af31655f79d36a1 Reviewed-on: https://code.wireshark.org/review/3169 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'capture_opts.c')
-rw-r--r--capture_opts.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 7b92f74760..313471f1b9 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -457,17 +457,11 @@ capture_opts_add_iface_opt(capture_options *capture_opts, const char *optarg_str
}
if_list = capture_interface_list(&err, &err_str, NULL);
if (if_list == NULL) {
- switch (err) {
-
- case CANT_GET_INTERFACE_LIST:
- case DONT_HAVE_PCAP:
+ if (err == 0)
+ cmdarg_err("There are no interfaces on which a capture can be done");
+ else {
cmdarg_err("%s", err_str);
g_free(err_str);
- break;
-
- case NO_INTERFACES_FOUND:
- cmdarg_err("There are no interfaces on which a capture can be done");
- break;
}
return 2;
}