summaryrefslogtreecommitdiff
path: root/dumpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-04-04 19:26:07 +0000
committerGuy Harris <guy@alum.mit.edu>2012-04-04 19:26:07 +0000
commit43ca745bb99d0a7d19cb89cbf1077ef8a1ae37c3 (patch)
tree06c21dad77853d4ae954da57d93bae4bc548daf5 /dumpcap.c
parent9c781b0939c6c4fc863f7f560bf46ca13349039a (diff)
downloadwireshark-43ca745bb99d0a7d19cb89cbf1077ef8a1ae37c3.tar.gz
Work around that WinPcap bug for another pcap_open() call.
svn path=/trunk/; revision=41938
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 85aa0497d1..1e53dabecd 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -637,6 +637,13 @@ open_capture_device(interface_options *interface_opts,
(interface_opts->datatx_udp ? PCAP_OPENFLAG_DATATX_UDP : 0) |
(interface_opts->nocap_rpcap ? PCAP_OPENFLAG_NOCAPTURE_RPCAP : 0),
CAP_READ_TIMEOUT, &auth, *open_err_str);
+ if ((*open_err_str)[0] == '\0') {
+ /* Work around known WinPcap bug wherein no error message is
+ filled in on a failure to open an rpcap: URL. */
+ g_strlcpy(*open_err_str,
+ "Unknown error (pcap bug; actual error cause not reported)",
+ sizef *open_err_str);
+ }
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG,
"pcap_open() returned %p.", (void *)pcap_h);
} else