aboutsummaryrefslogtreecommitdiffstats
path: root/caputils/capture-wpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-06-09 23:39:12 -0700
committerAnders Broman <a.broman58@gmail.com>2018-06-10 14:26:37 +0000
commit5ecbcaf483a552a8b78d525b9f32c5cfa575d59c (patch)
tree18d7afa2184d7c2954685d6743e8119676f890f3 /caputils/capture-wpcap.c
parente0b8837d9a62c7fd5964a7f35ee0dee01002e0ee (diff)
Improve the secondary error messages for pcap errors.
On Windows, if WinPcap isn't installed, warn about that for errors other than failed attempts to start capturing. On HP-UX, if we appear to have an old version of libpcap, warn about that for errors other than failed attempts to start capturing. If we know the error is a permissions problem, don't make suggestions appropriate to other problems. If we know the error is *not* a permissions problem, don't make suggestions appropriate to permissions problems. For permissions problems, or possible permissions problems, on Linux, suggest doing dpkg-reconfigure wireshark-common if you've installed from a package on Debian or a Debian derivative such as Ubuntu. Change-Id: If4aac0343095ac0b984eebc21853920c3b6d3c63 Ping-Bug: 14847 Reviewed-on: https://code.wireshark.org/review/28189 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'caputils/capture-wpcap.c')
-rw-r--r--caputils/capture-wpcap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/caputils/capture-wpcap.c b/caputils/capture-wpcap.c
index af2f4e6b5a..0b28494cc4 100644
--- a/caputils/capture-wpcap.c
+++ b/caputils/capture-wpcap.c
@@ -976,7 +976,8 @@ cant_get_if_list_error_message(const char *err_str)
}
if_capabilities_t *
-get_if_capabilities_local(interface_options *interface_opts, char **err_str)
+get_if_capabilities_local(interface_options *interface_opts,
+ cap_device_open_err *err, char **err_str)
{
/*
* We're not getting capaibilities for a remote device; use
@@ -985,14 +986,15 @@ get_if_capabilities_local(interface_options *interface_opts, char **err_str)
*/
#ifdef HAVE_PCAP_CREATE
if (p_pcap_create != NULL)
- return get_if_capabilities_pcap_create(interface_opts, err_str);
+ return get_if_capabilities_pcap_create(interface_opts, err, err_str);
#endif
- return get_if_capabilities_pcap_open_live(interface_opts, err_str);
+ return get_if_capabilities_pcap_open_live(interface_opts, err, err_str);
}
pcap_t *
open_capture_device_local(capture_options *capture_opts,
interface_options *interface_opts, int timeout,
+ cap_device_open_err *open_err,
char (*open_err_str)[PCAP_ERRBUF_SIZE])
{
/*
@@ -1003,10 +1005,10 @@ open_capture_device_local(capture_options *capture_opts,
#ifdef HAVE_PCAP_CREATE
if (p_pcap_create != NULL)
return open_capture_device_pcap_create(capture_opts,
- interface_opts, timeout, open_err_str);
+ interface_opts, timeout, open_err, open_err_str);
#endif
return open_capture_device_pcap_open_live(interface_opts, timeout,
- open_err_str);
+ open_err, open_err_str);
}
/*