configure: Check for struct icmpstat.

NetBSD no longer has statistics structures. Instead, it stores them as
arrays of integer counters. It's backwards compatible with the old
statistics structures, but the struct definitions are missing. This has
likely been broken on NetBSD for quite some time as a result.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Chip Davis 2022-04-15 19:28:15 -05:00 committed by Alexandre Julliard
parent 6ecf96d1a8
commit 0a70e1ac63
4 changed files with 49 additions and 1 deletions

26
configure vendored
View File

@ -20619,6 +20619,32 @@ printf "%s\n" "#define HAVE_STRUCT_IP_STATS_IPS_TOTAL 1" >>confdefs.h
fi
ac_fn_c_check_member "$LINENO" "struct icmpstat" "icps_error" "ac_cv_member_struct_icmpstat_icps_error" "#include <sys/types.h>
#ifdef HAVE_SYS_SOCKETVAR_H
#include <sys/socketvar.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif
#ifdef HAVE_NETINET_IP_ICMP_H
#include <netinet/ip_icmp.h>
#endif
#ifdef HAVE_NETINET_ICMP_VAR_H
#include <netinet/icmp_var.h>
#endif
"
if test "x$ac_cv_member_struct_icmpstat_icps_error" = xyes
then :
printf "%s\n" "#define HAVE_STRUCT_ICMPSTAT_ICPS_ERROR 1" >>confdefs.h
fi
ac_fn_c_check_member "$LINENO" "struct tcpstat" "tcps_connattempt" "ac_cv_member_struct_tcpstat_tcps_connattempt" "#include <sys/types.h>
#ifdef HAVE_SYS_SOCKETVAR_H
#include <sys/socketvar.h>

View File

@ -2218,6 +2218,25 @@ AC_CHECK_MEMBERS([struct ip_stats.ips_total],,,
#include <netinet/ip_var.h>
#endif])
dnl Check for struct icmpstat
AC_CHECK_MEMBERS([struct icmpstat.icps_error],,,
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKETVAR_H
#include <sys/socketvar.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif
#ifdef HAVE_NETINET_IP_ICMP_H
#include <netinet/ip_icmp.h>
#endif
#ifdef HAVE_NETINET_ICMP_VAR_H
#include <netinet/icmp_var.h>
#endif])
dnl Check for struct tcpstat
AC_CHECK_MEMBERS([struct tcpstat.tcps_connattempt],,,
[#include <sys/types.h>

View File

@ -299,7 +299,7 @@ static NTSTATUS ipv4_icmpstats_get_all_parameters( const void *key, UINT key_siz
fclose( fp );
return status;
}
#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS)
#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS) && defined(HAVE_STRUCT_ICMPSTAT_ICPS_ERROR)
{
int mib[] = { CTL_NET, PF_INET, IPPROTO_ICMP, ICMPCTL_STATS };
struct icmpstat icmp_stat;

View File

@ -443,6 +443,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if `icps_error' is a member of `struct icmpstat'. */
#undef HAVE_STRUCT_ICMPSTAT_ICPS_ERROR
/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_HWADDR