Chip Davis : configure: Check for struct icmpstat.

Alexandre Julliard julliard at winehq.org
Fri May 13 15:45:13 CDT 2022


Module: wine
Branch: master
Commit: 0a70e1ac63f0f378d2ebf16aa165f38aece720ef
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0a70e1ac63f0f378d2ebf16aa165f38aece720ef

Author: Chip Davis <cdavis5x at gmail.com>
Date:   Fri Apr 15 19:28:15 2022 -0500

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 at winehq.org>

---

 configure              | 26 ++++++++++++++++++++++++++
 configure.ac           | 19 +++++++++++++++++++
 dlls/nsiproxy.sys/ip.c |  2 +-
 include/config.h.in    |  3 +++
 4 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index f77409da444..5eff6d59592 100755
--- a/configure
+++ b/configure
@@ -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>
diff --git a/configure.ac b/configure.ac
index 630f0563527..5036857db71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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>
diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c
index b8fff704f38..69f286a41a0 100644
--- a/dlls/nsiproxy.sys/ip.c
+++ b/dlls/nsiproxy.sys/ip.c
@@ -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;
diff --git a/include/config.h.in b/include/config.h.in
index 45a0bd07abb..bc5ecdebc91 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -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
 




More information about the wine-cvs mailing list