aboutsummaryrefslogtreecommitdiffstats
path: root/capture-wpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-12-29 22:49:49 +0000
committerGuy Harris <guy@alum.mit.edu>2011-12-29 22:49:49 +0000
commit3864d5d19d5757ce74d5d282e36382a7fde1301f (patch)
treed2318cee0e6add2146cf4ae1e06723c92fe291ed /capture-wpcap.c
parent21f5ea24e4334afc1fc814bb9a510980921dd1b1 (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. svn path=/trunk/; revision=40334
Diffstat (limited to 'capture-wpcap.c')
-rw-r--r--capture-wpcap.c12
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);