client: tweak in MAC address code for struct lifconf

This commit is contained in:
David Anderson 2014-03-20 19:42:59 -07:00
parent eb46872508
commit 90fc7377fd
1 changed files with 4 additions and 0 deletions

View File

@ -264,7 +264,11 @@ int get_mac_address(char* address) {
hw_addr = (struct ether_addr *)&(item->lifr_lifru.lifru_enaddr);
#endif
strcpy(address, ether_ntoa(hw_addr));
#ifdef HAVE_STRUCT_LIFCONF
if (strstr(item->lifr_name, "eth")) break;
#else
if (strstr(item->ifr_name, "eth")) break;
#endif
}
close(sck);
if (!strcmp(address, "")) return -1;