aboutsummaryrefslogtreecommitdiff
path: root/pcap-rpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-03-13 20:14:57 -0700
committerGuy Harris <guy@alum.mit.edu>2017-03-13 20:14:57 -0700
commit77ac17c44f1a276b0d1149042a2a691a30f04ccd (patch)
tree7cbcb8f3410ae7040ee215268b67a2724a094e9a /pcap-rpcap.c
parent92e4d638fb3432d93ca4d5871300332879a829ce (diff)
downloadlibpcap-77ac17c44f1a276b0d1149042a2a691a30f04ccd.tar.gz
Fix remote opening and remote open error string return.
Pass the interface name, not the full URL, to pcap_create(). If pcap_open_rpcap() fails, copy the error message from the pcap_t to errbuf, as we'll be closing and freeing the pcap_t.
Diffstat (limited to 'pcap-rpcap.c')
-rw-r--r--pcap-rpcap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pcap-rpcap.c b/pcap-rpcap.c
index a126633e..67b3dcfb 100644
--- a/pcap-rpcap.c
+++ b/pcap-rpcap.c
@@ -2333,7 +2333,9 @@ pcap_t *pcap_open_rpcap(const char *source, int snaplen, int flags, int read_tim
result = pcap_opensource_remote(fp, auth);
- if (result != 0) {
+ if (result != 0)
+ {
+ strcpy(errbuf, fp->errbuf);
pcap_close(fp);
return NULL;
}