Subject: Re: pf and inet6
To: Andy Ruhl <acruhl@gmail.com>
From: Greg Troxel <gdt@ir.bbn.com>
List: netbsd-users
Date: 05/31/2005 08:33:48
There is a general issue with LKMs, which is that they, probably
necessarily, have to be compiled with the same options, or else more
complexity is needed.  I use a DIAGNOSTIC kernel, and found that lkms
wouldn't load.  So I added -DDIAGNOSTIC to my source tree in
src/sys/lkm/Makefile.inc:

Index: Makefile.inc
===================================================================
RCS file: /SINEW-CVS/netbsd/src/sys/lkm/Makefile.inc,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- Makefile.inc	12 Dec 2001 12:06:45 -0000	1.1.1.2
+++ Makefile.inc	13 Apr 2005 15:51:56 -0000	1.2
@@ -9,4 +9,6 @@
 
 WARNS?=	1
 
+CPPFLAGS+=	-DDIAGNOSTIC
+
 .endif	# __SYS_LKM_MAKEFILE_INC


Note that src/sys/lkm/net/pf (in 2.99.15 - I'm behind) has -DINET6
-DINET in CPPFLAGS.  I suspect if you remove that odds are good that
the pf module will work fine.

I don't have any bright ideas for addressing the larger module
consistency issue.  It might be good to define a M_INET6 variable that
expands to -DINET6 by default, which can be set to empty in mk.conf,
so that modules can be compiled with matching options with less effort.


-- 
        Greg Troxel <gdt@ir.bbn.com>