Fixed some compile problems under Solaris.
This commit is contained in:
parent
e8b2630620
commit
00c74e940d
|
@ -630,6 +630,7 @@ DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr,
|
||||||
*type = MIB_IF_TYPE_LOOPBACK;
|
*type = MIB_IF_TYPE_LOOPBACK;
|
||||||
memset(addr, 0, *len);
|
memset(addr, 0, *len);
|
||||||
*len = 0;
|
*len = 0;
|
||||||
|
ret=NOERROR;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
struct arpreq arp;
|
struct arpreq arp;
|
||||||
|
@ -639,7 +640,7 @@ DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr,
|
||||||
arp.arp_pa.sa_family = AF_INET;
|
arp.arp_pa.sa_family = AF_INET;
|
||||||
saddr = (struct sockaddr_in *)&arp; /* proto addr is first member */
|
saddr = (struct sockaddr_in *)&arp; /* proto addr is first member */
|
||||||
saddr->sin_family = AF_INET;
|
saddr->sin_family = AF_INET;
|
||||||
saddr->sin_addr.s_addr = getInterfaceAddrByName(name);
|
saddr->sin_addr.s_addr = getInterfaceIPAddrByName(name);
|
||||||
if ((ioctl(fd, SIOCGARP, &arp)))
|
if ((ioctl(fd, SIOCGARP, &arp)))
|
||||||
ret = ERROR_INVALID_DATA;
|
ret = ERROR_INVALID_DATA;
|
||||||
else {
|
else {
|
||||||
|
@ -661,9 +662,11 @@ DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ret = ERROR_NO_MORE_FILES;
|
ret = ERROR_NO_MORE_FILES;
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#elif defined (HAVE_SYS_SYSCTL_H) && defined (HAVE_NET_IF_DL_H)
|
#elif defined (HAVE_SYS_SYSCTL_H) && defined (HAVE_NET_IF_DL_H)
|
||||||
|
|
Loading…
Reference in New Issue