Am Freitag, den 09.01.2009, 08:20 +0100 schrieb Francois Gouget:
On Thu, 1 Jan 2009, Gerald Pfeifer wrote: [...]
ChangeLog: Only use RTF_LLINFO if #defined, fixing FreeBSD 8 after the arp-v2 rewrite.
[...]
#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
};
Is there a way to do it so the same binary can run and work on FreeBSD 7.x and 8.0?
#if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP) +#ifndef RTF_LLINFO +#define RTF_LLINFO 0 +#endif int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_LLINFO};
should do. (Even better: Put this define to the top of the file [but still #if-protected], and just use RTF_LLINFO later on)
Regards, Michael Karcher