iphlpapi: Enable non-privileged ICMP (ping) on Mac OS X.

This commit is contained in:
Ken Thomases 2011-02-11 16:02:02 -06:00 committed by Alexandre Julliard
parent e814147b12
commit d52f95cec8
1 changed files with 5 additions and 0 deletions

View File

@ -153,6 +153,11 @@ HANDLE WINAPI IcmpCreateFile(VOID)
icmp_t* icp;
int sid=socket(AF_INET,SOCK_RAW,IPPROTO_ICMP);
if (sid < 0)
{
/* Mac OS X supports non-privileged ICMP via SOCK_DGRAM type. */
sid=socket(AF_INET,SOCK_DGRAM,IPPROTO_ICMP);
}
if (sid < 0) {
ERR_(winediag)("Failed to use ICMP (network ping), this requires special permissions.\n");
SetLastError(ERROR_ACCESS_DENIED);