Re: Network interface modules keeps re-loading

From: Andrew Thompson <thompsa_at_freebsd.org>
Date: Sun, 13 May 2007 08:20:04 +1200
On Sat, May 12, 2007 at 06:17:38PM +0200, Fredrik Lindberg wrote:
> Hi
> 
> Due to some exciting interaction between kldunload, devctl/devd, rc(8)
> and ifconfig it's currently impossible to unload a network interface
> module (without stopping devd first).
> 
> The feature of having ifconfig loading modules was discussed briefly
> on current_at_ a while ago, but apparently nothing came out of it.
> 
> ifmaybeload() is called quite early in ifconfig, my suggestion is to
> only call it if there is at least one more argument except the interface
> name given on the command line.

> diff -u -u -r1.130 ifconfig.c
> --- ifconfig.c	24 Mar 2007 20:26:54 -0000	1.130
> +++ ifconfig.c	12 May 2007 16:13:39 -0000
> _at__at_ -229,7 +229,8 _at__at_
>  		argc--, argv++;
>  
>  		/* check and maybe load support for this interface */
> -		ifmaybeload(ifname);
> +		if (argc >= 1)
> +			ifmaybeload(ifname);

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.


Andrew
Received on Sat May 12 2007 - 18:20:06 UTC

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