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

Alexandre Julliard julliard at winehq.org
Mon Feb 14 10:02:06 CST 2011


Module: wine
Branch: master
Commit: d52f95cec83eb9da252df431fd93c4682ff4ec0c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d52f95cec83eb9da252df431fd93c4682ff4ec0c

Author: Ken Thomases <ken at codeweavers.com>
Date:   Fri Feb 11 16:02:02 2011 -0600

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

---

 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);




More information about the wine-cvs mailing list