svn commit: r208213 - head/etc

John Baldwin jhb at freebsd.org
Mon May 17 20:06:20 UTC 2010


On Monday 17 May 2010 3:51:34 pm John Baldwin wrote:
> Author: jhb
> Date: Mon May 17 19:51:34 2010
> New Revision: 208213
> URL: http://svn.freebsd.org/changeset/base/208213
> 
> Log:
>   Prevent unloading a kld for a driver that has subinterfaces (vlan and/or
>   wlan interfaces) from being automatically reloaded via devd shutdown
>   event handlers.
>   - Revert part of my previous changes to call ifn_stop on subinterfaces
>     when an interface is detached.  It is better to destroy the interfaces
>     first so that an 'ifconfig foo0.blah down' doesn't result in ifconfig
>     auto-loading if_foo.ko.  The ifconfig command will not be invoked if
>     foo0.blah is gone when ifn_stop() is called.  Furthermore, it is not
>     necessary to explicitly invoke ifn_stop() after the subinterface is
>     destroyed as devd will already do that.
>   - Pass -n to ifconfig when destroying interfaces so that destroying a
>     cloned interface does not kldload any drivers.

Arguably, ifconfig's autoloading behavior is probably a bit broken.  First, 
doing 'ifconfig foo0.blah <anything>' probably shouldn't try to autoload 
if_foo.ko.  It should try to trim off a string of digits at the end and then 
autoload the result instead of walking to find the first digit and then 
loading that.  Second, 'ifconfig <blah> destroy' should probably imply -n and 
not autoload anything.  An interface wouldn't exist to be destroyed unless its 
driver was already loaded.  Adding -n in network.subr is the most expedient 
fix, but I think fixing ifconfig is a better long term solution.

-- 
John Baldwin


More information about the svn-src-all mailing list