Subject: pfil_run_hooks? :netbsd-1.5.2
To: None <tech-net@netbsd.org>
From: Tomi Nylund <wizard@oulu.invalid>
List: tech-net
Date: 11/22/2001 16:44:54
Hello all,

I've been trying to convince a netbsd-1.5.2 syssrc+ipf-3.4.21 to compile 
with ipv6 support,
but failed to do so despite all my efforts. I've run into all kinds of
problems, been able to handle'em all, but this particular one.

First, here's how it looks for me:

1) ipf-3.4.21+syssrc-1.5.2, without ipv6: compiles without problems, but
   does NOT filter ipv6 (surprise, surprise)

2) ipf-3.4.21+syssrc-1.5.2, with ipv6, ip6protosw.h included into
ip_fil.c:
   compiles without problems WITH IPv6 enabled, but does NOT filter ipv6
   (surprise :)

3) Darren's reverted patch for ip6_forward.c + syssrc-1.5.2: does NOT
compile

4) reverted patch + ipf-3.4.21 + syssrc-1.5.2: does NOT compile, same
error as above.

The error in question looks like this:

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.

You can get rid of inet6_pfil_hook-error by including ip6protosw.h into
ip6_forward.c, but pfil_run_hooks is not on 1.5.2 source tree:
I imported a new pfil.h, pfil.c and dlt.h from -current, but that does
not even try to compile.

Does Darren or someone else have the rest of the patches needed to make
this work?
I can't get any further on my own (I'm not a C programmer..)

Any help greatly appreciated (I might even write a small paragraph into
FAQ if I can make this work).

Tomi