Commit 15f20663 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Cherry-picked fix for solaris compilation from 5.2

parent 657e8675
...@@ -100,14 +100,14 @@ my_bool my_gethwaddr(uchar *to) ...@@ -100,14 +100,14 @@ my_bool my_gethwaddr(uchar *to)
uint i; uint i;
for (i= 0; res && i < ifc.ifc_len / sizeof(ifr[0]); i++) for (i= 0; res && i < ifc.ifc_len / sizeof(ifr[0]); i++)
{ {
#ifdef SIOCGIFHWADDR #ifdef __linux__
if (ioctl(fd, SIOCGIFHWADDR, &ifr[i]) >= 0) if (ioctl(fd, SIOCGIFHWADDR, &ifr[i]) >= 0)
res= memcpy_and_test(to, (uchar *)&ifr[i].ifr_hwaddr.sa_data, res= memcpy_and_test(to, (uchar *)&ifr[i].ifr_hwaddr.sa_data,
ETHER_ADDR_LEN); ETHER_ADDR_LEN);
#else #else
/* /*
A bug in OpenSolaris prevents non-root from getting a mac address: A bug in OpenSolaris used to prevent non-root from getting a mac address:
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4720634 {no url. Oracle killed the old OpenSolaris bug database}
Thus, we'll use an alternative method and extract the address from the Thus, we'll use an alternative method and extract the address from the
arp table. arp table.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment