Fix MacOS compile error

This commit is contained in:
dijunkun
2023-10-07 10:07:45 +08:00
parent 36305eef46
commit 0a7dd291f1
5 changed files with 36 additions and 8 deletions

View File

@@ -231,7 +231,7 @@ std::string GetMac(char *mac_addr) {
(const struct sockaddr_dl *)cursor->ifa_addr;
if ((cursor->ifa_addr->sa_family == AF_LINK) &&
(socAddr->sdl_type == IFT_ETHER) &&
strcmp(if_name, cursor->ifa_name) == 0) {
strcmp(if_name.c_str(), cursor->ifa_name) == 0) {
dlAddr = (const struct sockaddr_dl *)cursor->ifa_addr;
const unsigned char *base =
(const unsigned char *)&dlAddr->sdl_data[dlAddr->sdl_nlen];