From c3c64562513814cc753911e56b6fbe2e013681d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 23 Jul 2008 16:34:53 +0000 Subject: [PATCH] For unfathomable reasons, ipfilter abuses kernel data structures for its own purposes. To pull this off, it defines _KERNEL before including the headers where these structures are defined. This leads to no end of trouble when some of these headers, or other headers that they include, change, as demonstrated by r180755. The quick fix in this particular case is to define _WANT_FILE instead of _KERNEL, conditional on __FreeBSD__. A better long-term fix is left as an exercise to the reader. --- contrib/ipfilter/ipsend/sock.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/contrib/ipfilter/ipsend/sock.c b/contrib/ipfilter/ipsend/sock.c index 9a2cfc3fb667..7d0157c9b37a 100644 --- a/contrib/ipfilter/ipsend/sock.c +++ b/contrib/ipfilter/ipsend/sock.c @@ -33,15 +33,23 @@ typedef int boolean_t; # ifdef __NetBSD__ # include # endif -# define _KERNEL -# define KERNEL +# ifdef __FreeBSD__ +# define _WANT_FILE +# else +# define _KERNEL +# define KERNEL +# endif # ifdef ultrix # undef LOCORE # include # endif # include -# undef _KERNEL -# undef KERNEL +# ifdef __FreeBSD__ +# undef _WANT_FILE +# else +# undef _KERNEL +# undef KERNEL +# endif #endif #include #include