If pcap_open_live() or pcap_open() fails due to not having WinPcap,

supply an appropriate error string.

svn path=/trunk/; revision=40330
This commit is contained in:
Guy Harris 2011-12-29 21:18:08 +00:00
parent dddb66178b
commit 757de7e1cf
1 changed files with 4 additions and 0 deletions

View File

@ -324,6 +324,8 @@ pcap_t*
pcap_open_live(const char *a, int b, int c, int d, char *e)
{
if (!has_wpcap) {
g_snprintf(e, "unable to load WinPcap (wpcap.dll); can't open %s to capture",
a);
return NULL;
}
return p_pcap_open_live(a, b, c, d, e);
@ -356,6 +358,8 @@ pcap_t*
pcap_open(const char *a, int b, int c, int d, struct pcap_rmtauth *e, char *f)
{
if (!has_wpcap) {
g_snprintf(f, "unable to load WinPcap (wpcap.dll); can't open %s to capture",
a);
return NULL;
}
return p_pcap_open(a, b, c, d, e, f);