Subject: Re: ipf & ipv6 again
To: None <tech-net@netbsd.org>
From: Tomi Nylund <wizard@oulu.invalid>
List: tech-net
Date: 11/21/2001 23:31:25
Manuel Bouyer wrote:

[...]

> > Stop.
> 
> You need a patch for ipf6 on 1.5.2. Here is what darrenr posted some time
> ago. Note that I didn't test it :)
> 
> --
> Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
> --

Thanks, I tested it, :) but ran into following problems when trying to
compile the kernel:

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.

I was able to make a clean compile with only ipf-3.4.21-specific
patches,
using the ./BSD/kupgrade, etc. after adding #define
<netinet6/ip6protosw.h>
into ip_fil.c, as per patch from ipfilter maillist, but no luck with
either ipf-specific patches+ ip6_forward patch, or without that patch 
on unmodified syssrc (the case detailed above).

Or, in plaintext:

1) syssrc+ipf-3.4.21: clean compile, no warnings for both binaries and
   kernel after patching.

2) syssrc+ipf-3.4.21+ip6_forward.c-patch: case shown above

3) syssrc+ip6_forward.c-patch: same thing

I'm not able to test the new kernel yet, I'll put it into screen to
compile
it for sparc, and test it out tomorrow. I haven't dug into source yet,
to
find out if I'm able to find out the inet6_pfil_hook and pfil_run_hooks
functions. Did Darren leave out some other needed patches, or is my
source, taken from cvs with -r netbsd-1-5 more modified than the
syssrc.tar.gz that comes with 1.5.2?
btw., you can also import the patch into your source tree with the
following command:

cvs update -d -P -D 10/20/01 syssrc/sys/netinet6/ip6_forward.c

This reverts ip6_forward.c into Darren-modified version.

Any ideas, what to do next? (Other than using -current ;)

I'll test out the case 1 tomorrow.


Tomi