Re: Network interface modules keeps re-loading

From: Brooks Davis <brooks_at_freebsd.org>
Date: Tue, 22 May 2007 09:26:32 -0500
On Tue, May 22, 2007 at 09:23:09AM +1200, Andrew Thompson wrote:
> On Sat, May 12, 2007 at 11:08:02PM +0200, Fredrik Lindberg wrote:
> > Andrew Thompson wrote:
> > >
> > >A similar solution to this was committed in rev1.129 of ifconfig.c but
> > >then backed out later as the module loading proved to be feature used by
> > >quite a few people. I think an example was being able to load and
> > >initialise an interface by just trying 'ifconfig foo0'.
> > >
> > >I think a different way to solve this is to add a argument to ifconfig
> > >to suppress the module loading and then use it at the appropriate places
> > >in rc.
> > >
> > 
> > Oh, I should have read the commit logs first, sorry about that.
> > Either way, I think something should be done about it. It certainly
> > annoyed me today before I could figure out what as going on.
> > When somebody issues a kldunload, they shouldn't get the module
> > re-loaded right away.
> > 
> > Clearly people want the current behavior (although I question it
> > myself), what would be an appropriate way to suppress loading?
> > ifconfig -n foo0, as in no-probe/load?
> 
> Here is a patch to do this, i'll commit it unless there are any
> objections.

The concept seems fine.  One small phrasing nit below.

> Index: ifconfig.8
> ===================================================================
> RCS file: /home/ncvs/src/sbin/ifconfig/ifconfig.8,v
> retrieving revision 1.137
> diff -u -p -r1.137 ifconfig.8
> --- ifconfig.8	17 Apr 2007 00:35:09 -0000	1.137
> +++ ifconfig.8	21 May 2007 21:15:18 -0000
> _at__at_ -1579,6 +1579,11 _at__at_ For example, the values of 802.11 WEP ke
>  the current user.
>  This information is not printed by default, as it may be considered
>  sensitive.
> +.Pp 
> +If the network interface driver is not present in the kernel then the module
> +will be loaded, the
> +.Fl n
> +flag suppresses this.

I'd say something like:

+If the network interface driver is not present in the kernel then
.Nm
will attempt to load it.
The
.Fl n
flag disables this behavior.

The key is that ifconfig is pretty stupid about loading things and can't
figure out what to load in some circumstances.

-- Brooks

Received on Tue May 22 2007 - 12:26:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:10 UTC