[2/2] iphlpapi: Check for struct icmpstat (for NetBSD)

André Hentschel nerv at dawncrow.de
Thu Jun 7 10:19:59 CDT 2012


there's no icmp_stats
http://bugs.winehq.org/show_bug.cgi?id=18160
---
 configure.ac            |    6 ++++++
 dlls/iphlpapi/ipstats.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index c92c326..9688ba7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2282,6 +2282,12 @@ AC_CHECK_MEMBERS([ns_msg._msg_ptr],,,
 # include <arpa/nameser.h>
 #endif])
 
+dnl Check for struct icmpstat
+AC_CHECK_MEMBERS([struct icmpstat.icps_inhist],,,
+[#ifdef HAVE_NETINET_ICMP_VAR
+#include <netinet/icmp_var.h>
+#endif])
+
 dnl Check for struct icmpstat.icps_outhist
 AC_CHECK_MEMBERS([struct icmpstat.icps_outhist],,,
 [#ifdef HAVE_SYS_TYPES_H
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 4d4cc2d..c5ec675 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -493,7 +493,7 @@ DWORD WINAPI GetIcmpStatistics(PMIB_ICMP stats)
         }
         if (kc) kstat_close( kc );
     }
-#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS)
+#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS) && HAVE_STRUCT_ICMPSTAT_ICPS_INHIST
     {
         int mib[] = {CTL_NET, PF_INET, IPPROTO_ICMP, ICMPCTL_STATS};
 #define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
-- 

Best Regards, André Hentschel


More information about the wine-patches mailing list