Who is to load dummynet.ko?

Luigi Rizzo rizzo at icir.org
Wed Mar 14 14:48:34 UTC 2007


On Wed, Mar 14, 2007 at 05:11:43PM +0300, Yar Tikhiy wrote:
> On Wed, Mar 14, 2007 at 04:35:06AM -0700, Luigi Rizzo wrote:
...
> > actually, i think it is the kernel itself (in the setsockopt handler,
> > once it validates the rule) that should load the module, and not leave
> > the task to the userland utility. Other modules already do this,
> > e.g. iwi loads the firmware autonomously, and maybe even netgraph components
> > do something similar.
> > 
> > For dummynet and divert, this can be surely put in the setsockopt
> > handler which is in ipfw.ko - if you need to autoload ipfw.ko,
> > then i am not sure where to put the hooks (in the kernel) but i am
> > pretty confident that there must be a good place.
> 
> As our fortune file puts it, "If God is dead, who will save the
> Queen?" :-)  We seem to have a sort of a chicken and egg problem

not really.
IP_FW_GET (and other commands) are processed in

	sys/netinet/raw_ip.c::rip_ctloutput()

so it's there that we can try and autoload the module (if ip_fw_ctl_ptr == NULL).

I don't know if there are hooks to autoload a protocol stack,
as some are not modules - no ipv4.ko, ipv6.ko, but there is arcnet.ko,
but you could in principle do the same thing with protocols and anywhere
there is a missing function, annotate it with the functions to
autoload the module supplying it.

	cheers
	luigi


More information about the freebsd-net mailing list