]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fix Windows build errors.
authorGuy Harris <[email protected]>
Thu, 7 Sep 2017 03:19:41 +0000 (20:19 -0700)
committerGuy Harris <[email protected]>
Thu, 7 Sep 2017 03:19:41 +0000 (20:19 -0700)
pcap-new.c
pcap-win32.c
pcap.c

index 229640856d59a07f8ad86eb59ff2d72a68acc77d..8c4b86a6446cbf677d2ade8f040110a079fd2d8a 100644 (file)
@@ -393,7 +393,7 @@ pcap_t *pcap_open(const char *source, int snaplen, int flags, int read_timeout,
         */
        /* disable loopback capture if requested */
        if (flags & PCAP_OPENFLAG_NOCAPTURE_LOCAL)
-               p->opt.nocapture_local = 1;
+               fp->opt.nocapture_local = 1;
 #endif /* _WIN32 */
        status = pcap_set_timeout(fp, read_timeout);
        if (status < 0)
index c1d24879ea007ef0ca7736404ea60c3aeb7ec4a9..c1f8352c4bdb526162bf65d193b6da6b9a0428fc 100644 (file)
@@ -406,7 +406,7 @@ pcap_sendqueue_transmit_win32(pcap_t *p, pcap_send_queue *queue, int sync)
        u_int res;
        char errbuf[PCAP_ERRBUF_SIZE+1];
 
-       if (2->adapter==NULL) {
+       if (pw->adapter==NULL) {
                pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
                    "Cannot transmit a queue to an offline capture or to a TurboCap port");
                return (0);
@@ -1221,7 +1221,7 @@ pcap_activate_win32(pcap_t *p)
         * all capture devices are regular OS network
         * interfaces.)
         */
-       p->handle = adapter->hFile;
+       p->handle = pw->adapter->hFile;
 
        return (0);
 bad:
diff --git a/pcap.c b/pcap.c
index fb5b13dc8416aebe846a203410d0678e78673924..01869797d9566bc835f410b7b02d356d1aeec437 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -36,7 +36,9 @@
 #endif
 
 #include <pcap-types.h>
-#ifndef _WIN32
+#ifdef _WIN32
+#include <Packet32.h>  /* for PacketGetVersion() */
+#else
 #include <sys/param.h>
 #ifndef MSDOS
 #include <sys/file.h>