ipfilter cannot be build within because warning's are present

Victor M. Blood freebsd at masm.elcom.ru
Wed Oct 17 14:48:33 PDT 2007


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
@@ -49,7 +49,7 @@
 # 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
@@ -58,12 +58,14 @@
 #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
@@ -2509,7 +2509,7 @@
        } 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
@@ -2772,7 +2772,7 @@
        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
@@ -50,7 +50,7 @@
 # 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
@@ -34,7 +34,7 @@
 #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






More information about the freebsd-current mailing list