diff --git a/include/ntop_win32.h b/include/ntop_win32.h index b0befff4fb..8411e615c9 100644 --- a/include/ntop_win32.h +++ b/include/ntop_win32.h @@ -170,7 +170,6 @@ struct win_in6_addr #define s6_addr in6_u.u6_addr8 #define s6_addr16 in6_u.u6_addr16 #define s6_addr32 in6_u.u6_addr32 - }; #define in6_addr win_in6_addr diff --git a/src/PcapInterface.cpp b/src/PcapInterface.cpp index a2b2f0a362..7c3991d56a 100644 --- a/src/PcapInterface.cpp +++ b/src/PcapInterface.cpp @@ -156,9 +156,19 @@ static void* packetPollLoop(void* ptr) { if((rc = pcap_next_ex(pd, &hdr, &pkt)) > 0) { if((rc > 0) && (pkt != NULL) && (hdr->caplen > 0)) { int a, b; +#ifdef WIN32 + u_char pkt_copy[1600]; + struct pcap_pkthdr hdr_copy; + memcpy(&hdr_copy, hdr, sizeof(hdr_copy)); + hdr_copy.len = min(hdr->len, sizeof(pkt_copy) - 1); + hdr_copy.caplen = min(hdr_copy.len, hdr_copy.caplen); + memcpy(pkt_copy, pkt, hdr_copy.len); + iface->packet_dissector(&hdr_copy, (const u_char*)pkt_copy, &a, &b); +#else hdr->caplen = min_val(hdr->caplen, iface->getMTU()); iface->packet_dissector(hdr, pkt, &a, &b); +#endif } } else if(rc < 0) { if(iface->read_from_pcap_dump()) diff --git a/third-party/zeromq-4.1.3/src/poller.hpp b/third-party/zeromq-4.1.3/src/poller.hpp index b91e551cdf..fff539d20c 100644 --- a/third-party/zeromq-4.1.3/src/poller.hpp +++ b/third-party/zeromq-4.1.3/src/poller.hpp @@ -38,6 +38,10 @@ #error More than one of the ZMQ_USE_* macros defined #endif +#ifdef WIN32 /* ntop */ +#define ZMQ_USE_SELECT 1 +#endif + #if defined ZMQ_USE_KQUEUE #include "kqueue.hpp" #elif defined ZMQ_USE_EPOLL