aboutsummaryrefslogtreecommitdiffstats
path: root/capture-wpcap.c
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2009-12-15 19:29:21 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2009-12-15 19:29:21 +0000
commit0cc9471af8974f56545b24b970831586231011b4 (patch)
treeb29ecb8bc7b66c442d9d37087a8250bdccec5eec /capture-wpcap.c
parentd18f871ffa3d78f3c189cf7b5cbe5c2f9b361719 (diff)
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
Diffstat (limited to 'capture-wpcap.c')
-rw-r--r--capture-wpcap.c10
1 files changed, 7 insertions, 3 deletions
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);
}