Module: wine Branch: stable Commit: 85f3c4cdf8d149cbf617ebada31de523035abdb3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=85f3c4cdf8d149cbf617ebada3... Author: Ken Thomases <ken(a)codeweavers.com> Date: Fri Feb 11 16:02:02 2011 -0600 iphlpapi: Enable non-privileged ICMP (ping) on Mac OS X. (cherry picked from commit d52f95cec83eb9da252df431fd93c4682ff4ec0c) --- dlls/iphlpapi/icmp.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c index d8ee101..2b76041 100644 --- a/dlls/iphlpapi/icmp.c +++ b/dlls/iphlpapi/icmp.c @@ -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);