Subject: Adding IPFILTER_COMPAT to GENERIC kernels
To: None <current-users@netbsd.org>
From: Martti Kuparinen <martti.kuparinen@iki.fi>
List: current-users
Date: 04/04/2005 07:12:29
Hi!

I'd like to add IPFILTER_COMPAT to all GENERIC kernels and also
build the userland ipf tools with this option. As the result users
should be able to use different ipf versions in kernel and userland.

Below is only change for the i386 GENERIC to show what I'm doing. My
plan to modify all src/sys/arch/*/conf/* which have IPFILTER_LOG setting
and if IPFILTER_LOG is commented-out then IPFILTER_COMPAT would be
commented-out as well.

Any objections for this change?

Once this is done I'd like this to be pulled up to netbsd-3 so we could
more easily update ipf in the future...

Martti



Index: GENERIC
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/conf/GENERIC,v
retrieving revision 1.664
diff -u -r1.664 GENERIC
--- GENERIC	3 Apr 2005 11:39:07 -0000	1.664
+++ GENERIC	4 Apr 2005 03:56:04 -0000
@@ -191,6 +191,7 @@
  options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
  options 	PFIL_HOOKS	# pfil(9) packet filter hooks
  options 	IPFILTER_LOG	# ipmon(8) log support
+options 	IPFILTER_COMPAT	# ipf(8) compability with older versions
  #options 	IPFILTER_DEFAULT_BLOCK	# block all packets by default
  #options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG

Index: Makefile.inc
===================================================================
RCS file: /cvsroot/src/usr.sbin/ipf/Makefile.inc,v
retrieving revision 1.15
diff -u -r1.15 Makefile.inc
--- Makefile.inc	10 Jan 2005 02:58:59 -0000	1.15
+++ Makefile.inc	4 Apr 2005 04:04:01 -0000
@@ -7,7 +7,7 @@
  CPPFLAGS+=	-I${NETBSDSRCDIR}/sys
  CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/dist/ipf
  CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/dist/ipf/netinet
-CPPFLAGS+=	-DSTATETOP -D__UIO_EXPOSE
+CPPFLAGS+=	-DSTATETOP -D__UIO_EXPOSE -DIPFILTER_COMPAT

  .if (${USE_INET6} == "no")
  CPPFLAGS+=	-DNOINET6
Index: checkrev.c
===================================================================
RCS file: /cvsroot/src/dist/ipf/lib/checkrev.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 checkrev.c
--- checkrev.c	28 Mar 2004 08:56:18 -0000	1.1.1.1
+++ checkrev.c	4 Apr 2005 04:05:10 -0000
@@ -39,8 +39,10 @@
  		return -1;
  	}

+#ifndef IPFILTER_COMPAT
  	if (strncmp(IPL_VERSION, fio.f_version, sizeof(fio.f_version))) {
  		return -1;
  	}
+#endif
  	return 0;
  }