Subject: Re: ipf & ipv6 again
To: None <tech-net@netbsd.org>
From: Tomi Nylund <wizard@oulu.invalid>
List: tech-net
Date: 11/22/2001 10:07:42
carl@bl.echidna.id.au wrote:
> 
> To get IPF filtering IPv6 on NBSD .1.5x, I had to use the patched
> netinet6/ip6_forward.c that Darren updated, and which was then removed
> a few days later.  Look through the CVS history to see what happened
> to that file.  Darren's changes got pulled.
> 
> This was on top of using IPF.recent, not the IPF.middleaged found in
> the CVS tree.
> 
> It works fine, as far as I've been able to tell.
> 
> Carl

Doesn't work for me ;(

It fails while trying to find out the whereabouts of pfil_run_hooks
function,
which I couldn't find anywhere, even by grepping through all of the
syssrc.

Did you use syssrc.tar.gz or syssrc from CVS? If so, which tags/date
versions
did you use?

Did you use ipf from basesrc/distfiles or from some other place?

How did you do it? ;)

For reference, this is how it looks:

When compiling kernel with -Werror:

cc  -O2 -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes 
-Wpointer-arith -Wno-uninitialized -Wno-main -I. -I../../../../arch
-I../../../.. -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -Di386  -c
../../../../netinet6/ip6_forward.c
cc1: warnings being treated as errors
../../../../netinet6/ip6_forward.c: In function `ip6_forward':
../../../../netinet6/ip6_forward.c:498: warning: implicit declaration of
function `pfil_run_hooks'
*** Error code 1

Stop.

And after removing -Werror from Makefile:
gcc gives the same warning, carries on, but fails to link:

cc -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes  -Wpointer-arith
-Wno-uninitialized -Wno-main -I../../../../../../lib/libkern/arch/i386
-I../../. -I../../../../../../arch -I../../../../../.. -nostdinc -DLKM
-DMAXUSERS=32 -D_KERNEL -Di386  -c
../../../../../../lib/libkern/pmatch.c
building standard kern library
cc  -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes  -Wpointer-arith
-Wno-uninitialized -Wno-main -I. -I../../../../arch -I../../../..
-nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -Di386  -c swapnetbsd.c
sh ../../../../conf/newvers.sh
cc  -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes  -Wpointer-arith
-Wno-uninitialized -Wno-main -I. -I../../../../arch -I../../../..
-nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -Di386  -c vers.c
rm -f netbsd
ld -Ttext c0100000 -e start -X -o netbsd ${SYSTEM_OBJ} vers.o
ip6_forward.o: In function `ip6_forward':
ip6_forward.o(.text+0x6f3): undefined reference to `inet6_pfil_hook'
ip6_forward.o(.text+0x6f8): undefined reference to `pfil_run_hooks'
*** Error code 1

Stop.