From 3864d5d19d5757ce74d5d282e36382a7fde1301f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 29 Dec 2011 22:49:49 +0000 Subject: 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. svn path=/trunk/; revision=40334 --- capture-wpcap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'capture-wpcap.c') 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 @@ -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); -- cgit v1.2.3