$NetBSD: patch-ad,v 1.12 2007/02/19 17:30:02 rillig Exp $

--- dlls/iphlpapi/ipstats.c.orig	2007-02-16 15:48:13.000000000 +0100
+++ dlls/iphlpapi/ipstats.c	2007-02-17 15:02:32.000000000 +0100
@@ -27,6 +27,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
@@ -627,7 +631,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++;
@@ -700,8 +708,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,
