diff --git a/configure b/configure index d9e1d65f45b..4428a2c1ce0 100755 --- a/configure +++ b/configure @@ -14028,6 +14028,20 @@ _ACEOF fi +ac_fn_c_check_member "$LINENO" "struct icmpstat" "icps_inhist" "ac_cv_member_struct_icmpstat_icps_inhist" "#ifdef HAVE_NETINET_ICMP_VAR +#include +#endif +" +if test "x$ac_cv_member_struct_icmpstat_icps_inhist" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_ICMPSTAT_ICPS_INHIST 1 +_ACEOF + + +fi + + ac_fn_c_check_member "$LINENO" "struct icmpstat" "icps_outhist" "ac_cv_member_struct_icmpstat_icps_outhist" "#ifdef HAVE_SYS_TYPES_H #include #endif diff --git a/configure.ac b/configure.ac index c92c326fe78..9688ba75efc 100644 --- a/configure.ac +++ b/configure.ac @@ -2282,6 +2282,12 @@ AC_CHECK_MEMBERS([ns_msg._msg_ptr],,, # include #endif]) +dnl Check for struct icmpstat +AC_CHECK_MEMBERS([struct icmpstat.icps_inhist],,, +[#ifdef HAVE_NETINET_ICMP_VAR +#include +#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 285e700eb9b..0edd0112a9c 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) && defined(HAVE_STRUCT_ICMPSTAT_ICPS_INHIST) { int mib[] = {CTL_NET, PF_INET, IPPROTO_ICMP, ICMPCTL_STATS}; #define MIB_LEN (sizeof(mib) / sizeof(mib[0])) diff --git a/include/config.h.in b/include/config.h.in index 20a0be30b1b..983c732b17f 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -791,6 +791,9 @@ /* Define to 1 if `direction' is a member of `struct ff_effect'. */ #undef HAVE_STRUCT_FF_EFFECT_DIRECTION +/* Define to 1 if `icps_inhist' is a member of `struct icmpstat'. */ +#undef HAVE_STRUCT_ICMPSTAT_ICPS_INHIST + /* Define to 1 if `icps_outhist' is a member of `struct icmpstat'. */ #undef HAVE_STRUCT_ICMPSTAT_ICPS_OUTHIST