ipfilter cannot be build within because warning's are present

From: Victor M. Blood <freebsd_at_masm.elcom.ru>
Date: Thu, 18 Oct 2007 01:48:32 +0400
Hi, All.

I try to use options in kernel instead of a module build of the
ipfilter and got error then kernel builds.

I'm edit files: fil.c, ip_auth.h, ip_auth.h, ip_log.c ip_compat.h and
correct #ifdef statament :) no more warnings...

--- sys/contrib/ipfilter/netinet/ip_log.c.orig  2007-10-18 01:28:36.000000000 +0400
+++ sys/contrib/ipfilter/netinet/ip_log.c       2007-10-18 01:30:47.000000000 +0400
_at__at_ -49,7 +49,7 _at__at_
 # undef _KERNEL
 # undef KERNEL
 #endif
-#if __FreeBSD_version >= 220000 && defined(_KERNEL)
+#if (defined(__FreeBSD_version) && (__FreeBSD_version >= 220000)) && defined(_KERNEL)
 # include <sys/fcntl.h>
 # include <sys/filio.h>
 #else
_at__at_ -58,12 +58,14 _at__at_
 #include <sys/time.h>
 #if defined(_KERNEL)
 # include <sys/systm.h>
-# if defined(NetBSD) && (__NetBSD_Version__ >= 104000000)
+# if (defined(NetBSD) && (__NetBSD_Version__ >= 104000000))
 #  include <sys/proc.h>
 # endif
 #endif /* _KERNEL */
 #if !SOLARIS && !defined(__hpux) && !defined(linux)
-# if (NetBSD > 199609) || (OpenBSD > 199603) || (__FreeBSD_version >= 300000)
+# if (defined(NetBSD) && (NetBSD > 199609)) || \
+       (defined(OpenBSD) && (OpenBSD > 199603)) || \
+       (defined(__FreeBSD_version) && (__FreeBSD_version >= 300000))
 #  include <sys/dirent.h>
 # else
 #  include <sys/dir.h>
--- sys/contrib/ipfilter/netinet/fil.c.orig     2007-10-18 01:27:16.000000000 +0400
+++ sys/contrib/ipfilter/netinet/fil.c  2007-10-18 01:30:38.000000000 +0400
_at__at_ -2509,7 +2509,7 _at__at_
        } else
 #endif
        {
-#if (OpenBSD >= 200311) && defined(_KERNEL)
+#if (defined(OpenBSD) && (OpenBSD >= 200311)) && defined(_KERNEL)
                ip->ip_len = ntohs(ip->ip_len);
                ip->ip_off = ntohs(ip->ip_off);
 #endif
_at__at_ -2772,7 +2772,7 _at__at_
        RWLOCK_EXIT(&ipf_global);
 
 #ifdef _KERNEL
-# if OpenBSD >= 200311
+# if (defined(OpenBSD) && (OpenBSD >= 200311))
        if (FR_ISPASS(pass) && (v == 4)) {
                ip = fin->fin_ip;
                ip->ip_len = ntohs(ip->ip_len);
--- sys/contrib/ipfilter/netinet/ip_auth.c.orig 2007-10-18 01:28:03.000000000 +0400
+++ sys/contrib/ipfilter/netinet/ip_auth.c      2007-10-18 01:30:30.000000000 +0400
_at__at_ -50,7 +50,7 _at__at_
 # include <sys/stream.h>
 # include <sys/kmem.h>
 #endif
-#if (_BSDI_VERSION >= 199802) || (__FreeBSD_version >= 400000)
+#if (defined(_BSDI_VERSION) && (_BSDI_VERSION >= 199802)) || (defined(__FreeBSD_version) &&(__FreeBSD_version >= 400000))
 # include <sys/queue.h>
 #endif
 #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(bsdi)
--- sys/contrib/ipfilter/netinet/ip_compat.h.orig       2007-10-18 01:29:24.000000000 +0400
+++ sys/contrib/ipfilter/netinet/ip_compat.h    2007-10-18 01:30:56.000000000 +0400
_at__at_ -34,7 +34,7 _at__at_
 #ifndef        SOLARIS
 #define        SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
 #endif
-#if SOLARIS2 >= 8
+#if (defined(SOLARIS2) && (SOLARIS2 >= 8))
 # ifndef       USE_INET6
 #  define      USE_INET6
 # endif


-- 
With all regards, Victor M. Blood.     mailto: freebsd_at_masm.elcom.ru
FTN: 2:5024/1.95_at_Fidonet.org, ICQ#3567656
Received on Wed Oct 17 2007 - 19:48:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:19 UTC