Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2002 07:50:05 -0800 (PST)
From:      Hiten Pandya <hiten@angelica.unixdaemons.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/46226: 5.0-RC1 ipfilter module [ipl.ko] fails to load
Message-ID:  <200212131550.gBDFo5T1025519@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/46226; it has been noted by GNATS.

From: Hiten Pandya <hiten@angelica.unixdaemons.com>
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 <sys/socketvar.h>
  #include <sys/systm.h>
  #include <sys/queue.h>
 +#include <sys/kernel.h>
 +#include <sys/module.h>
  
  #include <net/if.h>
  #include <net/pfil.h>
 @@ -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 <bsd.kmod.mk>
 %%%
 
 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212131550.gBDFo5T1025519>