From owner-freebsd-bugs Fri Dec 13 7:50: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2A7137B401 for ; Fri, 13 Dec 2002 07:50:05 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A04343EC2 for ; Fri, 13 Dec 2002 07:50:05 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBDFo5x3025522 for ; Fri, 13 Dec 2002 07:50:05 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBDFo5T1025519; Fri, 13 Dec 2002 07:50:05 -0800 (PST) Date: Fri, 13 Dec 2002 07:50:05 -0800 (PST) Message-Id: <200212131550.gBDFo5T1025519@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Hiten Pandya Subject: Re: kern/46226: 5.0-RC1 ipfilter module [ipl.ko] fails to load Reply-To: Hiten Pandya Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/46226; it has been noted by GNATS. From: Hiten Pandya To: bug-followup@FreeBSD.org Cc: jeff.stelzner@esca.com Subject: Re: kern/46226: 5.0-RC1 ipfilter module [ipl.ko] fails to load Date: Fri, 13 Dec 2002 10:39:47 -0500 > --In console boot messages I see [link_elf message repeats]: > Dec 10 16:14:03 lihue kernel: link_elf: symbol pfil_add_hook undefined > kldload: can't load ipl: No such file or directory OK. I tested this on my 28th Nov. CURRENT-JPSNAP, and the issue still persists. The reason you are getting that message, is because, apparently, ipfilter is dependant on the PFIL_HOOKS kernel option, and it cannot be loaded without it (I tried). So, either that you add the option to the kernel config file, and the problem will kinda go away. I do not think the former is an interesting thing to do, because ipfilter is a loadable module, then it makes less sense to recompile a kernel to satisfy a dependency. I have made some patches, which will make the PFIL_HOOKS into a loadable module, so you can avoid the trouble of recompiling your kernel. The patches are tested by me, but I would like to have your comments, i.e. if they work for you or not. To use the module option, you will need to make a "pfil" dir in sys/modules, and then apply the following patches (also available from: http://www.unixdaemons.com/~hiten/work/diffs/pfil_ipfilter_dep.patch) %%% Index: contrib/ipfilter/netinet/mlfk_ipl.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/contrib/ipfilter/netinet/mlfk_ipl.c,v retrieving revision 1.10 diff -u -r1.10 mlfk_ipl.c --- contrib/ipfilter/netinet/mlfk_ipl.c 19 Mar 2002 11:44:16 -0000 1.10 +++ contrib/ipfilter/netinet/mlfk_ipl.c 13 Dec 2002 07:32:01 -0000 @@ -198,3 +198,4 @@ 0 }; DECLARE_MODULE(ipfilter, ipfiltermod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); +MODULE_DEPEND(ipfilter, pfil, 1, 1, 1); Index: net/pfil.c =================================================================== RCS file: /home/hiten/ncvs/src/sys/net/pfil.c,v retrieving revision 1.5 diff -u -r1.5 pfil.c --- net/pfil.c 19 Mar 2002 21:54:18 -0000 1.5 +++ net/pfil.c 13 Dec 2002 07:32:33 -0000 @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -45,6 +47,14 @@ static int pfil_list_remove(pfil_list_t *, int (*)(void *, int, struct ifnet *, int, struct mbuf **)); +static int pfil_mod_handler(module_t mod, int cmd, void *data); + +static moduledata_t pfil_mod = { + "pfil", + pfil_mod_handler, + 0 +}; + static void pfil_init(ph) struct pfil_head *ph; @@ -169,3 +179,31 @@ } return NULL; } + +static int +pfil_mod_handler(module_t mod, int cmd, void *data) +{ + int error = 0; + + switch (cmd) { + case MOD_LOAD: + printf("Loaded PFIL_HOOKS\n"); + break; + + case MOD_UNLOAD: + break; + + case MOD_SHUTDOWN: + error = 0; + break; + + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +MODULE_VERSION(pfil, 1); +DECLARE_MODULE(pfil, pfil_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); --- /dev/null Fri Dec 13 07:33:00 2002 +++ modules/pfil/Makefile Fri Dec 13 07:32:45 2002 @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net + +KMOD= pfil +SRCS= pfil.c + +.include %%% Apply the patches in /usr/src/sys. Comments and suggestions welcome. -- Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org) http://www.unixdaemons.com/~hiten/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message