PcapPlusPlus: enhance platform support and fix missing syslink on Windows (#5419)
* Add test to detect missing iphlpapi linkage on Windows * Add the required iphlpapi linkage for Windows * Add support for Mingw * Simplify platform check * Add MacOS, Android and BSD * Add frameworks for MacOS * accurate MacOS framework * Fix complie issue on BSD caused by VLA usage * Fix patch file name * Add pthread syslink for Linux and BSD platformsautoupdate-croaring-v4.2.1
parent
8fbf38d4ba
commit
98a37fb428
2 changed files with 43 additions and 6 deletions
@ -0,0 +1,23 @@ |
||||
diff --git a/Pcap++/src/PcapLiveDevice.cpp b/Pcap++/src/PcapLiveDevice.cpp
|
||||
index 7ac0f79e..5faa7c4d 100644
|
||||
--- a/Pcap++/src/PcapLiveDevice.cpp
|
||||
+++ b/Pcap++/src/PcapLiveDevice.cpp
|
||||
@@ -1011,15 +1011,15 @@ namespace pcpp
|
||||
return;
|
||||
}
|
||||
|
||||
- uint8_t buf[len];
|
||||
+ std::vector<uint8_t> buf(len);
|
||||
|
||||
- if (sysctl(mib, 6, buf, &len, nullptr, 0) < 0)
|
||||
+ if (sysctl(mib, 6, buf.data(), &len, nullptr, 0) < 0)
|
||||
{
|
||||
PCPP_LOG_DEBUG("Error in retrieving MAC address: sysctl 2 error");
|
||||
return;
|
||||
}
|
||||
|
||||
- struct if_msghdr* ifm = (struct if_msghdr*)buf;
|
||||
+ struct if_msghdr* ifm = (struct if_msghdr*)buf.data();
|
||||
struct sockaddr_dl* sdl = (struct sockaddr_dl*)(ifm + 1);
|
||||
uint8_t* ptr = (uint8_t*)LLADDR(sdl);
|
||||
m_MacAddress = MacAddress(ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5]);
|
Loading…
Reference in new issue