Discussion:
defflag'ing ipfilter options
(too old to reply)
Christoph Badura
2009-12-14 22:43:26 UTC
Permalink
I've been annoyed for a while that most of the ipfilter options aren't
defflag'ed into opt_ipfilter.h and one has to rm(1) Just The Right(tm)
.o files before recompiling the kernel. Especially to get IPFILTER_LOOKUP
support for ippool(8).

Does anyone object to a change along the following lines?

While there I made the inclusion of opt_ipfilter_log.h vs. opt_ipfilter.h
depending on the same condition in all the files.

Index: netinet/files.ipfilter
===================================================================
RCS file: /cvsroot/src/sys/netinet/files.ipfilter,v
retrieving revision 1.8
diff -u -r1.8 files.ipfilter
--- netinet/files.ipfilter 17 Sep 2006 13:43:15 -0000 1.8
+++ netinet/files.ipfilter 14 Dec 2009 22:36:09 -0000
@@ -1,8 +1,14 @@
# $NetBSD: files.ipfilter,v 1.8 2006/09/17 13:43:15 yamt Exp $

defflag opt_ipfilter.h IPFILTER_LOG # logging of ip packets
+defparam opt_ipfilter.h IPFILTER_LOGSIZE
defflag opt_ipfilter.h IPFILTER_DEFAULT_BLOCK
+defflag opt_ipfilter.h IPFILTER_CKSUM
defflag opt_ipfilter.h IPFILTER_LOOKUP
+defflag opt_ipfilter.h IPFILTER_SCAN
+defflag opt_ipfilter.h IPFILTER_SYNC
+defflag opt_ipfilter.h IPFILTER_COMPILED
+defflag opt_ipfilter.h IPFILTER_BPF

defpseudo ipfilter: ifnet # XXX not really an ifnet

Index: dist/ipf/netinet/fil.c
===================================================================
RCS file: /cvsroot/src/sys/dist/ipf/netinet/fil.c,v
retrieving revision 1.45
diff -u -r1.45 fil.c
--- dist/ipf/netinet/fil.c 19 Aug 2009 08:36:10 -0000 1.45
+++ dist/ipf/netinet/fil.c 14 Dec 2009 22:36:15 -0000
@@ -19,7 +19,7 @@
#include <sys/time.h>
#if defined(__NetBSD__)
# if (NetBSD >= 199905) && !defined(IPFILTER_LKM) && defined(_KERNEL)
-# if (__NetBSD_Version__ < 301000000)
+# if (__NetBSD_Version__ < 399001400)
# include "opt_ipfilter_log.h"
# else
# include <sys/cdefs.h>
Index: dist/ipf/netinet/ip_proxy.c
===================================================================
RCS file: /cvsroot/src/sys/dist/ipf/netinet/ip_proxy.c,v
retrieving revision 1.19
diff -u -r1.19 ip_proxy.c
--- dist/ipf/netinet/ip_proxy.c 19 Aug 2009 08:36:11 -0000 1.19
+++ dist/ipf/netinet/ip_proxy.c 14 Dec 2009 22:36:15 -0000
@@ -46,6 +46,15 @@
# include <sys/mbuf.h>
# endif
#endif
+#if defined(__NetBSD__)
+# if (NetBSD >= 199905) && !defined(IPFILTER_LKM) && defined(_KERNEL)
+# if (__NetBSD_Version__ < 399001400)
+# include "opt_ipfilter_log.h"
+# else
+# include "opt_ipfilter.h"
+# endif
+# endif
+#endif
#if defined(_KERNEL) && (__FreeBSD_version >= 220000)
# include <sys/filio.h>
# include <sys/fcntl.h>
Index: dist/ipf/netinet/ip_sync.c
===================================================================
RCS file: /cvsroot/src/sys/dist/ipf/netinet/ip_sync.c,v
retrieving revision 1.12
diff -u -r1.12 ip_sync.c
--- dist/ipf/netinet/ip_sync.c 19 Aug 2009 08:36:13 -0000 1.12
+++ dist/ipf/netinet/ip_sync.c 14 Dec 2009 22:36:15 -0000
@@ -39,6 +39,13 @@
#endif
#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
# include <sys/proc.h>
+# if (NetBSD >= 199905) && !defined(IPFILTER_LKM) && defined(_KERNEL)
+# if (__NetBSD_Version__ < 399001400)
+# include "opt_ipfilter_log.h"
+# else
+# include "opt_ipfilter.h"
+# endif
+# endif
#endif
#if defined(_KERNEL) && (__FreeBSD_version >= 220000)
# include <sys/filio.h>

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Darren Reed
2009-12-15 02:37:32 UTC
Permalink
Post by Christoph Badura
I've been annoyed for a while that most of the ipfilter options aren't
defflag'ed into opt_ipfilter.h and one has to rm(1) Just The Right(tm)
.o files before recompiling the kernel. Especially to get IPFILTER_LOOKUP
support for ippool(8).
Does anyone object to a change along the following lines?
While there I made the inclusion of opt_ipfilter_log.h vs. opt_ipfilter.h
depending on the same condition in all the files.
Index: netinet/files.ipfilter
===================================================================
RCS file: /cvsroot/src/sys/netinet/files.ipfilter,v
retrieving revision 1.8
diff -u -r1.8 files.ipfilter
--- netinet/files.ipfilter 17 Sep 2006 13:43:15 -0000 1.8
+++ netinet/files.ipfilter 14 Dec 2009 22:36:09 -0000
@@ -1,8 +1,14 @@
# $NetBSD: files.ipfilter,v 1.8 2006/09/17 13:43:15 yamt Exp $
defflag opt_ipfilter.h IPFILTER_LOG # logging of ip packets
+defparam opt_ipfilter.h IPFILTER_LOGSIZE
defflag opt_ipfilter.h IPFILTER_DEFAULT_BLOCK
+defflag opt_ipfilter.h IPFILTER_CKSUM
defflag opt_ipfilter.h IPFILTER_LOOKUP
+defflag opt_ipfilter.h IPFILTER_SCAN
+defflag opt_ipfilter.h IPFILTER_SYNC
+defflag opt_ipfilter.h IPFILTER_COMPILED
+defflag opt_ipfilter.h IPFILTER_BPF
defpseudo ipfilter: ifnet # XXX not really an ifnet
And although it doesn't do anything much in current source,
you should add IPFILTER_COMPAT to the list above (see email
I sent a few minutes ago.)

Darren

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christoph Badura
2009-12-15 17:34:50 UTC
Permalink
Post by Darren Reed
And although it doesn't do anything much in current source,
you should add IPFILTER_COMPAT to the list above (see email
I sent a few minutes ago.)
And I guess, as you mentioned to me recently, IPSTATE_SIZE and
related ones. A quick grep gives me NAT_SIZE, RDR_SIZE, and HOSTMAP_SIZE.
Anything else?

--chris


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Darren Reed
2009-12-15 22:54:42 UTC
Permalink
Post by Christoph Badura
Post by Darren Reed
And although it doesn't do anything much in current source,
you should add IPFILTER_COMPAT to the list above (see email
I sent a few minutes ago.)
And I guess, as you mentioned to me recently, IPSTATE_SIZE and
related ones. A quick grep gives me NAT_SIZE, RDR_SIZE, and HOSTMAP_SIZE.
Anything else?
IPSTATE_SIZE
IPSTATE_MAX
NAT_SIZE
RDR_SIZE
NAT_TABLE_MAX
NAT_TABLE_SZ
HOSTMAP_SIZE

Darren

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...