Fix dlls/iphlpapi/ipstats.c for FreeBSD 8
Gerald Pfeifer
gerald at pfeifer.com
Wed Jan 28 04:40:42 CST 2009
This still is broken after me providing a patch four weeks ago. Let
me try again with the alternate approach from my previous submission.
Gerald
ChangeLog:
#define RTF_LLINFO if not in system headers.
Index: dlls/iphlpapi/ipstats.c
===================================================================
RCS file: /home/wine/wine/dlls/iphlpapi/ipstats.c,v
retrieving revision 1.44
diff -u -3 -p -r1.44 ipstats.c
--- dlls/iphlpapi/ipstats.c 27 Jan 2009 15:08:57 -0000 1.44
+++ dlls/iphlpapi/ipstats.c 28 Jan 2009 10:37:37 -0000
@@ -142,6 +142,10 @@
#define RTF_MULTICAST 0 /* Not available on NetBSD/OpenBSD */
#endif
+#ifndef RTF_LLINFO
+#define RTF_LLINFO 0 /* Not available on FreeBSD 8 and above */
+#endif
+
WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)
On Wed, 21 Jan 2009, Gerald Pfeifer wrote:
> On Fri, 9 Jan 2009, Gerald Pfeifer wrote:
>> I am not aware of one. Tijl and me actually argued to get the
>> original behavior back (for this and other reasons like source
>> compatbility) but failed. I just pushed again.
>
> FreeBSD upstream is not going to change, from what I can tell, so we
> really need something like the following patch.
>
> If you guys prefer something like
>
> #ifndef RTF_LLINFO
> #define RTF_LLINFO 0
> #endif
>
> instead, I can also create a patch for that!
>
> Gerald
>
> ======== original message ========
> From: Gerald Pfeifer <gerald at pfeifer.com>
> To: wine-patches at winehq.org
> Date: Thu, 1 Jan 2009 20:32:51
> Subject: Adjust dlls/iphlpapi/ipstats.c to FreeBSD 8
>
> FreeBSD 8 is seeing a major rewrite of the arp code which removed
> the RTF_LLINFO flag and thus broke Wine, among others, see
> http://lists.freebsd.org/pipermail/freebsd-net/2008-December/020464.html
> and the follow-ups for details.
>
> The patch below is the solution for Wine (and other ports) agreed upon
> by the respective FreeBSD core maintainers; a variant thereof has been
> explicitly reviewed and approved.
>
> Gerald
>
> ChangeLog:
> Only use RTF_LLINFO if #defined, fixing FreeBSD 8 after the arp-v2
> rewrite.
>
> Index: dlls/iphlpapi/ipstats.c
> ===================================================================
> RCS file: /home/wine/wine/dlls/iphlpapi/ipstats.c,v
> retrieving revision 1.37
> diff -u -3 -p -r1.37 ipstats.c
> --- dlls/iphlpapi/ipstats.c 30 Jun 2008 13:28:42 -0000 1.37
> +++ dlls/iphlpapi/ipstats.c 1 Jan 2009 19:24:21 -0000
> @@ -1250,7 +1250,13 @@ DWORD getRouteTable(PMIB_IPFORWARDTABLE
> DWORD getNumArpEntries(void)
> {
> #if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP)
> - int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_LLINFO};
> + int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS,
> +#ifdef RTF_LLINFO
> + RTF_LLINFO
> +#else
> + 0
> +#endif
> + };
> #define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
> DWORD arpEntries = 0;
> size_t needed;
> @@ -1308,7 +1314,13 @@ DWORD getArpTable(PMIB_IPNETTABLE *ppIpN
> #if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP)
> if (table)
> {
> - int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_LLINFO};
> + int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS,
> +#ifdef RTF_LLINFO
> + RTF_LLINFO
> +#else
> + 0
> +#endif
> + };
> #define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
> size_t needed;
> char *buf, *lim, *next;
More information about the wine-patches
mailing list