From 0cc9471af8974f56545b24b970831586231011b4 Mon Sep 17 00:00:00 2001 From: gerald Date: Tue, 15 Dec 2009 19:29:21 +0000 Subject: Behave more gracefully if WinPcap isn't installed. Don't assert if we call pcap_open or pcap_open_live when WinPcap isn't loaded - just return NULL. Don't display the "NPF driver isn't running" dialog if we're capturing from stdin or a file. Fix a cut-and-paste error in capture_pcap_linktype_list. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31275 f5534014-38df-0310-8fa8-9805f1628bb7 --- capture-wpcap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'capture-wpcap.c') diff --git a/capture-wpcap.c b/capture-wpcap.c index 1c925e2bfe..584e989cdf 100644 --- a/capture-wpcap.c +++ b/capture-wpcap.c @@ -295,15 +295,19 @@ pcap_lookupnet(const char *a, bpf_u_int32 *b, bpf_u_int32 *c, char *d) pcap_t* pcap_open_live(const char *a, int b, int c, int d, char *e) { - g_assert(has_wpcap); - return p_pcap_open_live(a, b, c, d, e); + if (!has_wpcap) { + return NULL; + } + return p_pcap_open_live(a, b, c, d, e); } #ifdef HAVE_PCAP_REMOTE pcap_t* pcap_open(const char *a, int b, int c, int d, struct pcap_rmtauth *e, char *f) { - g_assert(has_wpcap); + if (!has_wpcap) { + return NULL; + } return p_pcap_open(a, b, c, d, e, f); } -- cgit v1.2.3