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

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


there's no udp_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 46e448e..c92c326 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2342,6 +2342,12 @@ AC_CHECK_MEMBERS([struct tcp_stats.tcps_connattempt],,,
 #include <netinet/tcp_var.h>
 #endif])
 
+dnl Check for struct udpstat
+AC_CHECK_MEMBERS([struct udpstat.udps_ipackets],,,
+[#ifdef HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif])
+
 dnl Check for struct ifreq.ifr_hwaddr
 AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr],,,
 [#ifdef HAVE_SYS_TYPES_H
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 41cb779..4d4cc2d 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -927,7 +927,7 @@ DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS stats)
         }
         if (kc) kstat_close( kc );
     }
-#elif defined(HAVE_SYS_SYSCTL_H) && defined(UDPCTL_STATS)
+#elif defined(HAVE_SYS_SYSCTL_H) && defined(UDPCTL_STATS) && HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS
     {
         int mib[] = {CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_STATS};
 #define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
-- 

Best Regards, André Hentschel


More information about the wine-patches mailing list