diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-12-29 22:49:49 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-12-29 22:49:49 +0000 |
commit | 76daecec9608bb43cee0a939e1025c96d8d1a053 (patch) | |
tree | d2318cee0e6add2146cf4ae1e06723c92fe291ed /capture-wpcap.c | |
parent | a6e63acbaeb5c58c790640e0e035a06efaf1dfe9 (diff) |
Add an additional DONT_HAVE_PCAP return value from get_interface_list()
and capture_interface_list(). Return it if, on Windows, we ask for the
interface list but don't have WinPcap installed. Handle it like
CANT_GET_INTERFACE_LIST.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40334 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture-wpcap.c')
-rw-r--r-- | capture-wpcap.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/capture-wpcap.c b/capture-wpcap.c index 9dd7903ddd..f831f225f1 100644 --- a/capture-wpcap.c +++ b/capture-wpcap.c @@ -35,6 +35,8 @@ #include "capture_ifinfo.h" #include "capture-pcap-util.h" #include "capture-pcap-util-int.h" +#include "capture-wpcap.h" +#include "capture_errs.h" #include <wsutil/file_util.h> @@ -694,6 +696,16 @@ get_interface_list(int *err, char **err_str) int i, j; char errbuf[PCAP_ERRBUF_SIZE]; + if (!has_wpcap) { + /* + * We don't have WinPcap, so we can't get a list of + * interfaces. + */ + *err = DONT_HAVE_PCAP; + *err_str = cant_load_winpcap_err("you"); + return NULL; + } + #ifdef HAVE_PCAP_FINDALLDEVS if (p_pcap_findalldevs != NULL) return get_interface_list_findalldevs(err, err_str); |