cvs commit: src/sbin/ifconfig ifconfig.c

Yar Tikhiy yar at comp.chem.msu.su
Mon Mar 12 20:49:31 UTC 2007


On Tue, Mar 13, 2007 at 07:20:49AM +1300, Andrew Thompson wrote:
> On Mon, Mar 12, 2007 at 01:08:56PM +0000, Yar Tikhiy wrote:
> > yar         2007-03-12 13:08:56 UTC
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:
> >     sbin/ifconfig        ifconfig.c 
> >   Log:
> >   Attempt to load the kernel module only if we are going to create a
> >   new interface.  In other cases loading the module is unwanted and
> >   can lead to ill side effects.  One such effect found is as follows:
> >   "kldunload if_foo" tells the module to kill all its interfaces,
> >   which results in messages sent to devd; the module unloads.  Then
> >   devd starts processing the messages, which ends up in a etc script
> >   running ifconfig fooX, which reloads the module.
>    
> Great catch! I had been wondering why it had been necessary to unload
> networking modules twice lately.

Yeah, just noticed the weird thing today.

Now I'm in doubt whether it is OK to MFC this change.  It
has a little side effect, too.  Namely it burns the bridge
to old-style networking modules that create some interfaces
as soon as loaded.  Among stock interfaces, those are lo,
enc, and pflog.  Fortunately, neither lo nor enc is built
as a separate module; and ifconfig can't load pflog anyway
because the module name isn't if_pflog.ko -- for now
/etc/rc.d/pflog takes care of loading pflog.ko.  So the
only concern left is that somebody somewhere uses such an
old-style 3rd-party module and relies on the command

	ifconfig foo0 inet blah-blah-blah up

loading the module and thus making foo0 appear instantly,
without an explicit `create' parameter to ifconfig.

-- 
Yar


More information about the cvs-src mailing list