|
Hi, After applying Andrey's patch, ipfilter binaries compiled. But kernel didn't. I got the following error: cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions -std=c99 -nostdinc -I- -I. -I/usr/src/sys -I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys/contrib/dev/ath -I/usr/src/sys/contrib/dev/ath/freebsd -I/usr/src/sys/contrib/ngatm -D_KERNEL -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Werror /usr/src/sys/contrib/ipfilter/netinet/fil.c /usr/src/sys/contrib/ipfilter/netinet/fil.c: In function `ipf_genericiter': /usr/src/sys/contrib/ipfilter/netinet/fil.c:6796: warning: type of "uid" defaults to "int" *** Error code 1 ipf_genericiter's code is below /* ------------------------------------------------------------------------ */ /* Function: fr_genericiter */ /* Returns: int - 0 = success, else error */ /* Parameters: data(I) - the token type to match */ /* uid(I) - uid owning the token */ /* ptr(I) - context pointer for the token */ /* */ /* ------------------------------------------------------------------------ */ int ipf_genericiter(data, uid, ctx) void *data, *ctx; { ipftoken_t *token; ipfgeniter_t iter; ip_fil.h says uid is integer. extern int ipf_genericiter __P((void *, int, void *)); And adding int uid; line after declaration of data and ctx will solve this compile problem. After that, trying to make buildkernel gives the following error linking kernel fil.o(.text+0x4b7f): In function `ipf_freetoken': : undefined reference to `ip_lookup_iterderef' *** Error code 1 Kernel Conf: options IPFILTER options IPFILTER_LOG -- Necati Ersen SISECI EnderUnix Core Team Member EnderUnix SDT ~ Turkey http://www.enderunix.org -------- Orijinal Mesaj --------
Merhaba, The same problem with FreeBSD 6.x. I sent description of this and other problems to Darren. Using the following patch I can compile it on FreeBSD 6.x and 5.5, but on 6.x I got one panic (I will try to reproduce it again).
--- ip_fil_freebsd.c.orig Mon Sep 25 13:21:35 2006
+++ ip_fil_freebsd.c Fri Oct 13 10:39:49 2006
@@ -65,6 +65,9 @@
# endif
#endif
#include <net/route.h>
+#if (__FreeBSD_version >= 501000)
+# include <net/netisr.h>
+#endif
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/in_systm.h>
@@ -441,7 +444,7 @@
, p)
# if (__FreeBSD_version >= 500024)
struct thread *p;
-# define p_uid t_proc->p_cred->p_ruid
+# define p_uid td_ucred->cr_ruid
# else
struct proc *p;
# define p_uid p_cred->p_ruid
@@ -1600,13 +1603,13 @@
return ip;
}
+extern struct ifqueue ipintrq;
int ipf_inject(fin, m)
fr_info_t *fin;
mb_t *m;
{
int error;
- mb_t *m;
if (fin->fin_out == 0) {
struct ifqueue *ifq;
@@ -1615,6 +1618,7 @@
#if (__FreeBSD_version >= 501000)
netisr_dispatch(NETISR_IP, m);
+ error = 0;
#else
if (IF_QFULL(ifq)) {
|
