$NetBSD: patch-ad,v 1.13 2007/07/17 12:29:17 adam Exp $

--- dlls/iphlpapi/ipstats.c.orig	2007-07-13 19:46:16.000000000 +0200
+++ dlls/iphlpapi/ipstats.c
@@ -28,6 +28,10 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#if defined(__NetBSD__)
+#include <sys/param.h>
+#endif
+#include <unistd.h>
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -740,7 +744,11 @@ DWORD getNumRoutes(void)
 
       /* Ignore all entries except for gateway routes which aren't
          multicast */
+#if !defined(RTF_MULTICAST)
+      if (!(rtm->rtm_flags & RTF_GATEWAY))
+#else
       if (!(rtm->rtm_flags & RTF_GATEWAY) || (rtm->rtm_flags & RTF_MULTICAST))
+#endif
          continue;
 
       RouteCount++;
@@ -813,8 +821,12 @@ DWORD getRouteTable(PMIB_IPFORWARDTABLE 
 
           /* Ignore all entries except for gateway routes which aren't
              multicast */
+#if !defined(RTF_MULTICAST)
+          if (!(rtm->rtm_flags & RTF_GATEWAY))
+#else
           if (!(rtm->rtm_flags & RTF_GATEWAY) ||
               (rtm->rtm_flags & RTF_MULTICAST))
+#endif
              continue;
 
           memset (&table->table[table->dwNumEntries], 0,
